Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332AbbDMLzQ (ORCPT ); Mon, 13 Apr 2015 07:55:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42187 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752492AbbDMLzL (ORCPT ); Mon, 13 Apr 2015 07:55:11 -0400 From: Denys Vlasenko To: linux-kernel@vger.kernel.org Cc: Denys Vlasenko , FUJITA Tomonori Subject: [PATCH 3/4] deinline dma_map_single_attrs() Date: Mon, 13 Apr 2015 13:54:34 +0200 Message-Id: <1428926075-28796-4-git-send-email-dvlasenk@redhat.com> In-Reply-To: <1428926075-28796-1-git-send-email-dvlasenk@redhat.com> References: <1428926075-28796-1-git-send-email-dvlasenk@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3958 Lines: 113 Reduces kernel size by 43259 bytes on allyesconfig build: text data bss dec hex filename 82517277 22255384 20627456 125400117 7797435 vmlinux2 82474018 22255384 20627456 125356858 778cb3a vmlinux3 I did not find a suitable .c file to move this function to, so I added a new one, kernel/dma-mapping-common.c Signed-off-by: Denys Vlasenko Cc: FUJITA Tomonori Cc: linux-kernel@vger.kernel.org --- include/asm-generic/dma-mapping-common.h | 22 ++++----------------- kernel/Makefile | 3 ++- kernel/dma-mapping-common.c | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 kernel/dma-mapping-common.c diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index 3378dcf..688f86b 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h @@ -7,24 +7,10 @@ #include #include -static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, - size_t size, - enum dma_data_direction dir, - struct dma_attrs *attrs) -{ - struct dma_map_ops *ops = get_dma_ops(dev); - dma_addr_t addr; - - kmemcheck_mark_initialized(ptr, size); - BUG_ON(!valid_dma_direction(dir)); - addr = ops->map_page(dev, virt_to_page(ptr), - (unsigned long)ptr & ~PAGE_MASK, size, - dir, attrs); - debug_dma_map_page(dev, virt_to_page(ptr), - (unsigned long)ptr & ~PAGE_MASK, size, - dir, addr, true); - return addr; -} +dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, + size_t size, + 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, diff --git a/kernel/Makefile b/kernel/Makefile index 1408b33..8c8b683 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -9,7 +9,8 @@ obj-y = fork.o exec_domain.o panic.o \ extable.o params.o \ kthread.o sys_ni.o nsproxy.o \ notifier.o ksysfs.o cred.o reboot.o \ - async.o range.o groups.o smpboot.o + async.o range.o groups.o smpboot.o \ + dma-mapping-common.o ifdef CONFIG_FUNCTION_TRACER # Do not trace debug files and internal ftrace files diff --git a/kernel/dma-mapping-common.c b/kernel/dma-mapping-common.c new file mode 100644 index 0000000..17457a4 --- /dev/null +++ b/kernel/dma-mapping-common.c @@ -0,0 +1,33 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 + * of the License. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + */ +#include +#include + +dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, + size_t size, + enum dma_data_direction dir, + struct dma_attrs *attrs) +{ + struct dma_map_ops *ops = get_dma_ops(dev); + dma_addr_t addr; + + kmemcheck_mark_initialized(ptr, size); + BUG_ON(!valid_dma_direction(dir)); + addr = ops->map_page(dev, virt_to_page(ptr), + (unsigned long)ptr & ~PAGE_MASK, size, + dir, attrs); + debug_dma_map_page(dev, virt_to_page(ptr), + (unsigned long)ptr & ~PAGE_MASK, size, + dir, addr, true); + return addr; +} +EXPORT_SYMBOL(dma_map_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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/