History

swiotlb: Add CONFIG_HAS_IOMEM check around swiotlb_mem_remap()

HAS_IOMEM option may not be selected on some platforms (e.g, s390) and this will cause compilation failure due to missing memremap() implementation. Fix it by stubbing out swiotlb_mem_remap when CONFIG_HAS_IOMEM is not set.

Wei Liu committed 4 years ago

Commit 2deb55d1 parent e1878401 file · +7 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/dma/swiotlb.c+7−0
@@ -163,6 +163,7 @@ static inline unsigned long nr_slots(u64 val) · 162 unmodified lines
163163 * when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP
164164 * Isolation VMs).
165165 */
166+#ifdef CONFIG_HAS_IOMEM
166167 static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
167168 {
168169 void *vaddr = NULL;
@@ -178,6 +179,12 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) · 9 unmodified lines
178179
179180 return vaddr;
180181 }
182+#else
183+static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
184+{
185+ return NULL;
186+}
187+#endif
181188
182189 /*
183190 * Early SWIOTLB allocation may be too early to allow an architecture to

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t