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>
This commit is contained in:
Christoph Hellwig 2018-04-03 15:41:07 +02:00
parent 33782714dc
commit 79c1879ee5
13 changed files with 12 additions and 47 deletions

View File

@ -345,9 +345,6 @@ config PCI_DOMAINS
config PCI_SYSCALL config PCI_SYSCALL
def_bool PCI def_bool PCI
config IOMMU_HELPER
def_bool PCI
config ALPHA_NONAME config ALPHA_NONAME
bool bool
depends on ALPHA_BOOK1 || ALPHA_NONAME_CH depends on ALPHA_BOOK1 || ALPHA_NONAME_CH

View File

@ -1780,9 +1780,6 @@ config SECCOMP
config SWIOTLB config SWIOTLB
def_bool y def_bool y
config IOMMU_HELPER
def_bool SWIOTLB
config PARAVIRT config PARAVIRT
bool "Enable paravirtualization code" bool "Enable paravirtualization code"
help help

View File

@ -251,9 +251,6 @@ config SMP
config SWIOTLB config SWIOTLB
def_bool y def_bool y
config IOMMU_HELPER
def_bool SWIOTLB
config KERNEL_MODE_NEON config KERNEL_MODE_NEON
def_bool y def_bool y

View File

@ -612,6 +612,3 @@ source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
config IOMMU_HELPER
def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)

View File

@ -67,16 +67,12 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY
help help
Lock the kernel's implementation of memcpy() into L2. Lock the kernel's implementation of memcpy() into L2.
config IOMMU_HELPER
bool
config NEED_SG_DMA_LENGTH config NEED_SG_DMA_LENGTH
bool bool
config SWIOTLB config SWIOTLB
def_bool y def_bool y
select DMA_DIRECT_OPS select DMA_DIRECT_OPS
select IOMMU_HELPER
select NEED_SG_DMA_LENGTH select NEED_SG_DMA_LENGTH
config OCTEON_ILM config OCTEON_ILM

View File

@ -130,9 +130,6 @@ config LOONGSON_UART_BASE
default y default y
depends on EARLY_PRINTK || SERIAL_8250 depends on EARLY_PRINTK || SERIAL_8250
config IOMMU_HELPER
bool
config NEED_SG_DMA_LENGTH config NEED_SG_DMA_LENGTH
bool bool
@ -141,7 +138,6 @@ config SWIOTLB
default y default y
depends on CPU_LOONGSON3 depends on CPU_LOONGSON3
select DMA_DIRECT_OPS select DMA_DIRECT_OPS
select IOMMU_HELPER
select NEED_SG_DMA_LENGTH select NEED_SG_DMA_LENGTH
select NEED_DMA_MAP_STATE select NEED_DMA_MAP_STATE

View File

@ -83,9 +83,6 @@ endif
config NLM_COMMON config NLM_COMMON
bool bool
config IOMMU_HELPER
bool
config NEED_SG_DMA_LENGTH config NEED_SG_DMA_LENGTH
bool bool

View File

@ -483,7 +483,6 @@ config IOMMU_HELPER
config SWIOTLB config SWIOTLB
bool "SWIOTLB support" bool "SWIOTLB support"
default n default n
select IOMMU_HELPER
---help--- ---help---
Support for IO bounce buffering for systems without an IOMMU. Support for IO bounce buffering for systems without an IOMMU.
This allows us to DMA to the full physical address space on This allows us to DMA to the full physical address space on

View File

@ -44,9 +44,6 @@ config SWIOTLB
def_bool y def_bool y
select DMA_DIRECT_OPS select DMA_DIRECT_OPS
config IOMMU_HELPER
def_bool SWIOTLB
config NEED_SG_DMA_LENGTH config NEED_SG_DMA_LENGTH
def_bool SWIOTLB def_bool SWIOTLB

View File

@ -934,7 +934,7 @@ config SWIOTLB
config IOMMU_HELPER config IOMMU_HELPER
def_bool y def_bool y
depends on CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU depends on CALGARY_IOMMU || GART_IOMMU
config MAXSMP config MAXSMP
bool "Enable Maximum number of SMP Processors and NUMA Nodes" bool "Enable Maximum number of SMP Processors and NUMA Nodes"

View File

@ -103,11 +103,6 @@ config IOMMU_SBA
depends on PCI_LBA depends on PCI_LBA
default PCI_LBA default PCI_LBA
config IOMMU_HELPER
bool
depends on IOMMU_SBA || IOMMU_CCIO
default y
source "drivers/pcmcia/Kconfig" source "drivers/pcmcia/Kconfig"
endmenu endmenu

View File

@ -2,6 +2,7 @@
#ifndef _LINUX_IOMMU_HELPER_H #ifndef _LINUX_IOMMU_HELPER_H
#define _LINUX_IOMMU_HELPER_H #define _LINUX_IOMMU_HELPER_H
#include <linux/bug.h>
#include <linux/kernel.h> #include <linux/kernel.h>
static inline unsigned long iommu_device_max_index(unsigned long size, static inline unsigned long iommu_device_max_index(unsigned long size,
@ -14,9 +15,15 @@ static inline unsigned long iommu_device_max_index(unsigned long size,
return size; return size;
} }
extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, static inline int iommu_is_span_boundary(unsigned int index, unsigned int nr,
unsigned long shift, unsigned long shift, unsigned long boundary_size)
unsigned long boundary_size); {
BUG_ON(!is_power_of_2(boundary_size));
shift = (shift + index) & (boundary_size - 1);
return shift + nr > boundary_size;
}
extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
unsigned long start, unsigned int nr, unsigned long start, unsigned int nr,
unsigned long shift, unsigned long shift,

View File

@ -4,17 +4,7 @@
*/ */
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/bug.h> #include <linux/iommu-helper.h>
int iommu_is_span_boundary(unsigned int index, unsigned int nr,
unsigned long shift,
unsigned long boundary_size)
{
BUG_ON(!is_power_of_2(boundary_size));
shift = (shift + index) & (boundary_size - 1);
return shift + nr > boundary_size;
}
unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
unsigned long start, unsigned int nr, unsigned long start, unsigned int nr,