Received: by 10.223.185.116 with SMTP id b49csp4999115wrg; Wed, 7 Mar 2018 04:52:02 -0800 (PST) X-Google-Smtp-Source: AG47ELvYWDPSTc/mPb//+UgztzCbotiJoQfSeTOjOuOlHiMCxY+DtqVI2kxCmu3T3cCO0DPo2Pdc X-Received: by 2002:a17:902:9a45:: with SMTP id x5-v6mr10553092plv.18.1520427122196; Wed, 07 Mar 2018 04:52:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520427122; cv=none; d=google.com; s=arc-20160816; b=xOC3NtXeuPHZxYW2rqyWw8dZrvQTGnVmgvjh2OypMtAiJSM7f5EgecOx73vpLBfpSX 4kOmnRtpCBgPsbbAKeXokb/fIGWLUu4Stf3zMwj7uc71x4pHpKWJ25nfau3VHfmY2zk+ knHAivXSGqy2XVx8YMBj46vNNceB5Ix3IB3Vz8/eIFMmqPpOKgxxo6azuNs42cMtNvi/ 8ma1L4ieGtufNwVH03N8DoeiMLXZ/gPa1rneKpxa4tRTMcooCNDg8W/ldiAmjtfvUTVv c6UdB4q3OZpfJ9UusGPUMn2ktn1+DNNU4zlmzbWwC8BA33ATZTzb1K1nb3V3+QMepQRI Rn4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=tweHfG58H7v4kQzHiNji/ZjkuFn5vPQRMrbd8wo7QrM=; b=DKuNtC+vdUqbnEbyYOukWx2JqvVPBB8O0ftIhvNOC6nPzyH6N+YJOP1/bF5vVNAmgv x6ITRBbZP3FKGOfSgiOQBqZ0eEC8wy6d8TJfrT9EAZO4qq/W62s7CvpIcbb2ka7FXpNu 87vMqiKWie7VSVA9SYTBkH0BoRt5wRhczG79IGBuwNTAZZ5haSXC46jBnRNUhL3+f4vw sYUIsECbwlch8JF8TyzVLcX2VwO4tRMFcUBa+sQK1Q4vCLBi63pQt1Gu0eboVo0wIYiB kW9ONyMvxVxsFVeBDO4soWsz/DlXZAo8n5RWxSrMG3yKR5bv47gN7E0iurGLQ+KXIpt2 rp6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=NdL9bTyJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si11459028pge.478.2018.03.07.04.51.47; Wed, 07 Mar 2018 04:52:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=NdL9bTyJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754518AbeCGMs4 (ORCPT + 99 others); Wed, 7 Mar 2018 07:48:56 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46655 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbeCGMrb (ORCPT ); Wed, 7 Mar 2018 07:47:31 -0500 Received: by mail-wr0-f195.google.com with SMTP id m12so2017898wrm.13 for ; Wed, 07 Mar 2018 04:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tweHfG58H7v4kQzHiNji/ZjkuFn5vPQRMrbd8wo7QrM=; b=NdL9bTyJHbWNmytyxMSTHSguMzQnJkJRmmUM2K2iwZmuu8f0Ulgw3SxUs60/MAan9F Bp3cGTlmD3S1/5Qal9HiDiw+N06ctvyExgvUcqG820/EV6Z93sEVjjg4u3ULQnUJXQPS YOY+XrwirlSq+tq7+Nwd6+WXhNY/sJnse7vR63CUTHYEULOq29Pdi0URyAbnN9eD6WsZ sQjwalSjv5y8gRfZgbxBDKPMtG2kopMaJuFl0RGJzlBIM3gAGdlQ1qmB6pXzDiS1Belq g/dXyXHOc0DVpbaq69hawBn6df1Y8oEqPINIujjOX9Oqx9HKwUyJKYo6yssqdq70hf7C +eVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tweHfG58H7v4kQzHiNji/ZjkuFn5vPQRMrbd8wo7QrM=; b=lcG8ZtGuV/BPLYGNnilDDssqBWy4MwzkdUY7HlBykW35xhOXhK/QGOe3/kNy1PDGIF hiXIBWUDfCuupv4sOmBcQdb5cXBomhj5C0+bRttT36REE+kuBw8HWt8K/0+cuDY5p8mM /EmULn8AkCbZag075j0TMsB0G06QxfrKVNBULv9p751g9SWqEjIXIDjjVroc7kB0viAO v2OR9kA8kbeHfdniUMNdaKBv9RWwPWBnuU/qUxI+/RKW+GfAWGJmBRhRQKdcUM6mb3w6 aW0jzXPsFGfzFMlu6yktvHwtuBc+ckIv/VLQtYgCyy+8loui8H2/2MQkZORRbNwc2ue5 yTsg== X-Gm-Message-State: APf1xPBBkBUVKaH7v2HjcCnoNMFuxJ2RTPt2ZP3eq4rm1otSGWOFG5/1 Q7i2bYwRe45qR5aTq5X3NGsTeWnX X-Received: by 10.223.171.6 with SMTP id q6mr20444182wrc.267.1520426850019; Wed, 07 Mar 2018 04:47:30 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id x78sm24325756wmd.2.2018.03.07.04.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 04:47:29 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: linux-kernel@vger.kernel.org Cc: Tvrtko Ursulin , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Jens Axboe Subject: [PATCH 4/6] lib/scatterlist: Unexport some trivial wrappers Date: Wed, 7 Mar 2018 12:47:10 +0000 Message-Id: <20180307124712.14963-5-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180307124712.14963-1-tvrtko.ursulin@linux.intel.com> References: <20180307124712.14963-1-tvrtko.ursulin@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tvrtko Ursulin Save some kernel size by moving trivial wrappers to header as static inline instead of exporting symbols for them. Signed-off-by: Tvrtko Ursulin Cc: Bart Van Assche Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Jens Axboe --- include/linux/scatterlist.h | 38 ++++++++++++++++++++++++++++++++++---- lib/scatterlist.c | 36 ------------------------------------ 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 2144de41ee04..f665a278011a 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -280,12 +280,42 @@ int sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages, struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order, bool chainable, gfp_t gfp, unsigned int *nent_p); -struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp, - unsigned int *nent_p); void sgl_free_n_order(struct scatterlist *sgl, unsigned int nents, unsigned int order); -void sgl_free_order(struct scatterlist *sgl, unsigned int order); -void sgl_free(struct scatterlist *sgl); + +/** + * sgl_alloc - allocate a scatterlist and its pages + * @length: Length in bytes of the scatterlist + * @gfp: Memory allocation flags + * @nent_p: [out] Number of entries in the scatterlist + * + * Returns: A pointer to an initialized scatterlist or %NULL upon failure. + */ +static inline struct scatterlist * +sgl_alloc(unsigned long length, gfp_t gfp, unsigned int *nent_p) +{ + return sgl_alloc_order(length, 0, false, gfp, nent_p); +} + +/** + * sgl_free_order - free a scatterlist and its pages + * @sgl: Scatterlist with one or more elements + * @order: Second argument for __free_pages() + */ +static inline void sgl_free_order(struct scatterlist *sgl, unsigned int order) +{ + sgl_free_n_order(sgl, UINT_MAX, order); +} + +/** + * sgl_free - free a scatterlist and its pages + * @sgl: Scatterlist with one or more elements + */ +static inline void sgl_free(struct scatterlist *sgl) +{ + sgl_free_order(sgl, 0); +} + #endif /* CONFIG_SGL_ALLOC */ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, diff --git a/lib/scatterlist.c b/lib/scatterlist.c index e13a759c5c49..c637849482d3 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -537,21 +537,6 @@ struct scatterlist *sgl_alloc_order(unsigned long length, unsigned int order, } EXPORT_SYMBOL(sgl_alloc_order); -/** - * sgl_alloc - allocate a scatterlist and its pages - * @length: Length in bytes of the scatterlist - * @gfp: Memory allocation flags - * @nent_p: [out] Number of entries in the scatterlist - * - * Returns: A pointer to an initialized scatterlist or %NULL upon failure. - */ -struct scatterlist *sgl_alloc(unsigned long length, gfp_t gfp, - unsigned int *nent_p) -{ - return sgl_alloc_order(length, 0, false, gfp, nent_p); -} -EXPORT_SYMBOL(sgl_alloc); - /** * sgl_free_n_order - free a scatterlist and its pages * @sgl: Scatterlist with one or more elements @@ -583,27 +568,6 @@ void sgl_free_n_order(struct scatterlist *sgl, unsigned int nents, } EXPORT_SYMBOL(sgl_free_n_order); -/** - * sgl_free_order - free a scatterlist and its pages - * @sgl: Scatterlist with one or more elements - * @order: Second argument for __free_pages() - */ -void sgl_free_order(struct scatterlist *sgl, unsigned int order) -{ - sgl_free_n_order(sgl, UINT_MAX, order); -} -EXPORT_SYMBOL(sgl_free_order); - -/** - * sgl_free - free a scatterlist and its pages - * @sgl: Scatterlist with one or more elements - */ -void sgl_free(struct scatterlist *sgl) -{ - sgl_free_order(sgl, 0); -} -EXPORT_SYMBOL(sgl_free); - #endif /* CONFIG_SGL_ALLOC */ void __sg_page_iter_start(struct sg_page_iter *piter, -- 2.14.1