Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu-helper: mark iommu_is_span_boundary as inline

This avoids selecting IOMMU_HELPER just for this function. And we only
use it once or twice in normal builds so this often even is a size
reduction.

Signed-off-by: Christoph Hellwig <hch@lst.de>

+12 -47
-3
arch/alpha/Kconfig
··· 345 345 config PCI_SYSCALL 346 346 def_bool PCI 347 347 348 - config IOMMU_HELPER 349 - def_bool PCI 350 - 351 348 config ALPHA_NONAME 352 349 bool 353 350 depends on ALPHA_BOOK1 || ALPHA_NONAME_CH
-3
arch/arm/Kconfig
··· 1780 1780 config SWIOTLB 1781 1781 def_bool y 1782 1782 1783 - config IOMMU_HELPER 1784 - def_bool SWIOTLB 1785 - 1786 1783 config PARAVIRT 1787 1784 bool "Enable paravirtualization code" 1788 1785 help
-3
arch/arm64/Kconfig
··· 251 251 config SWIOTLB 252 252 def_bool y 253 253 254 - config IOMMU_HELPER 255 - def_bool SWIOTLB 256 - 257 254 config KERNEL_MODE_NEON 258 255 def_bool y 259 256
-3
arch/ia64/Kconfig
··· 612 612 source "crypto/Kconfig" 613 613 614 614 source "lib/Kconfig" 615 - 616 - config IOMMU_HELPER 617 - def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
-4
arch/mips/cavium-octeon/Kconfig
··· 67 67 help 68 68 Lock the kernel's implementation of memcpy() into L2. 69 69 70 - config IOMMU_HELPER 71 - bool 72 - 73 70 config NEED_SG_DMA_LENGTH 74 71 bool 75 72 76 73 config SWIOTLB 77 74 def_bool y 78 75 select DMA_DIRECT_OPS 79 - select IOMMU_HELPER 80 76 select NEED_SG_DMA_LENGTH 81 77 82 78 config OCTEON_ILM
-4
arch/mips/loongson64/Kconfig
··· 130 130 default y 131 131 depends on EARLY_PRINTK || SERIAL_8250 132 132 133 - config IOMMU_HELPER 134 - bool 135 - 136 133 config NEED_SG_DMA_LENGTH 137 134 bool 138 135 ··· 138 141 default y 139 142 depends on CPU_LOONGSON3 140 143 select DMA_DIRECT_OPS 141 - select IOMMU_HELPER 142 144 select NEED_SG_DMA_LENGTH 143 145 select NEED_DMA_MAP_STATE 144 146
-3
arch/mips/netlogic/Kconfig
··· 83 83 config NLM_COMMON 84 84 bool 85 85 86 - config IOMMU_HELPER 87 - bool 88 - 89 86 config NEED_SG_DMA_LENGTH 90 87 bool 91 88
-1
arch/powerpc/Kconfig
··· 483 483 config SWIOTLB 484 484 bool "SWIOTLB support" 485 485 default n 486 - select IOMMU_HELPER 487 486 ---help--- 488 487 Support for IO bounce buffering for systems without an IOMMU. 489 488 This allows us to DMA to the full physical address space on
-3
arch/unicore32/mm/Kconfig
··· 44 44 def_bool y 45 45 select DMA_DIRECT_OPS 46 46 47 - config IOMMU_HELPER 48 - def_bool SWIOTLB 49 - 50 47 config NEED_SG_DMA_LENGTH 51 48 def_bool SWIOTLB 52 49
+1 -1
arch/x86/Kconfig
··· 934 934 935 935 config IOMMU_HELPER 936 936 def_bool y 937 - depends on CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU 937 + depends on CALGARY_IOMMU || GART_IOMMU 938 938 939 939 config MAXSMP 940 940 bool "Enable Maximum number of SMP Processors and NUMA Nodes"
-5
drivers/parisc/Kconfig
··· 103 103 depends on PCI_LBA 104 104 default PCI_LBA 105 105 106 - config IOMMU_HELPER 107 - bool 108 - depends on IOMMU_SBA || IOMMU_CCIO 109 - default y 110 - 111 106 source "drivers/pcmcia/Kconfig" 112 107 113 108 endmenu
+10 -3
include/linux/iommu-helper.h
··· 2 2 #ifndef _LINUX_IOMMU_HELPER_H 3 3 #define _LINUX_IOMMU_HELPER_H 4 4 5 + #include <linux/bug.h> 5 6 #include <linux/kernel.h> 6 7 7 8 static inline unsigned long iommu_device_max_index(unsigned long size, ··· 15 14 return size; 16 15 } 17 16 18 - extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, 19 - unsigned long shift, 20 - unsigned long boundary_size); 17 + static inline int iommu_is_span_boundary(unsigned int index, unsigned int nr, 18 + unsigned long shift, unsigned long boundary_size) 19 + { 20 + BUG_ON(!is_power_of_2(boundary_size)); 21 + 22 + shift = (shift + index) & (boundary_size - 1); 23 + return shift + nr > boundary_size; 24 + } 25 + 21 26 extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, 22 27 unsigned long start, unsigned int nr, 23 28 unsigned long shift,
+1 -11
lib/iommu-helper.c
··· 4 4 */ 5 5 6 6 #include <linux/bitmap.h> 7 - #include <linux/bug.h> 8 - 9 - int iommu_is_span_boundary(unsigned int index, unsigned int nr, 10 - unsigned long shift, 11 - unsigned long boundary_size) 12 - { 13 - BUG_ON(!is_power_of_2(boundary_size)); 14 - 15 - shift = (shift + index) & (boundary_size - 1); 16 - return shift + nr > boundary_size; 17 - } 7 + #include <linux/iommu-helper.h> 18 8 19 9 unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, 20 10 unsigned long start, unsigned int nr,