[PATCH 4/4] deinline dma_unmap_single_attrs()

From: Denys Vlasenko
Date: Mon Apr 13 2015 - 07:55:23 EST


Reduces kernel size by 26947 bytes on allyesconfig build:

text data bss dec hex filename
82474018 22255384 20627456 125356858 778cb3a vmlinux3
82447071 22255384 20627456 125329911 77861f7 vmlinux4

Signed-off-by: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
include/asm-generic/dma-mapping-common.h | 16 ++++------------
kernel/dma-mapping-common.c | 14 ++++++++++++++
2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 688f86b..0684d9c 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -12,18 +12,10 @@ dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
enum dma_data_direction dir,
struct dma_attrs *attrs);

-static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
- size_t size,
- enum dma_data_direction dir,
- struct dma_attrs *attrs)
-{
- struct dma_map_ops *ops = get_dma_ops(dev);
-
- BUG_ON(!valid_dma_direction(dir));
- if (ops->unmap_page)
- ops->unmap_page(dev, addr, size, dir, attrs);
- debug_dma_unmap_page(dev, addr, size, dir, true);
-}
+void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
+ size_t size,
+ enum dma_data_direction dir,
+ struct dma_attrs *attrs);

static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
int nents, enum dma_data_direction dir,
diff --git a/kernel/dma-mapping-common.c b/kernel/dma-mapping-common.c
index 17457a4..75e514e 100644
--- a/kernel/dma-mapping-common.c
+++ b/kernel/dma-mapping-common.c
@@ -31,3 +31,17 @@ dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
return addr;
}
EXPORT_SYMBOL(dma_map_single_attrs);
+
+void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
+ size_t size,
+ enum dma_data_direction dir,
+ struct dma_attrs *attrs)
+{
+ struct dma_map_ops *ops = get_dma_ops(dev);
+
+ BUG_ON(!valid_dma_direction(dir));
+ if (ops->unmap_page)
+ ops->unmap_page(dev, addr, size, dir, attrs);
+ debug_dma_unmap_page(dev, addr, size, dir, true);
+}
+EXPORT_SYMBOL(dma_unmap_single_attrs);
--
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/