From patchwork Fri May 25 21:45:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 137001 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp96357lji; Fri, 25 May 2018 14:46:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOPmXIY5tt34wh+UqG74Fc/vIlMOE/V75LC6NqKkDt+D5oxyhWUEekbXhjyPXduxUVHtKd X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr4170770plc.341.1527284791278; Fri, 25 May 2018 14:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527284791; cv=none; d=google.com; s=arc-20160816; b=WwI1VPJmj1LE61e+KoAGBcOYyzBqadCA0iGFZru5ZWYkN2p9XSt5QmN2g6zXeBbuiS rDH0qoUanEWC6pqZAIzxYtpdwrb4Rc82r2fqafuoNpUS1DEoW3a6Y8rcK7+EbCZ6JnU/ GbQGB6OE35ewFUi4AGmt7IHc7MSg9uIslgqod6DNsjD9w8u+jx43YcBaYCHSyplGka68 p4+RNcVKmfF1o0csSAi+LCI15kfEHZBSjcgXIoUokUWICmPH0tJFGEeqhbEL7EQGpT37 JY3JB3fKL/VhTGZ5Bs8HquIwVKnihpgYU9L/BNjfU5D80eiicFGLIIAYPwCdb1M74qeO HDMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :arc-authentication-results; bh=kB6+E4Xd1Rgo/mRdTC9dDYwAE8zKxpH4xQoQk3lnB9U=; b=sysPJV+stzjlYbR9VtxOteuMTBJ69gDt9CG/Q2x8KQar0B+unhBu07t/6xtGGK5rnY rSQUOObXBBdzGa3YoclKvgQ5V5GaheXh3LMtVjeSvHaBmMt39fVgSfY4+lcXjqRmCZWB Y/cL4K+03LZaojsqh0zjzOIhqCY1lyDqwAFX56bB6WejJO8e7MO3VDxHQMRWnYg5fLbA Y2/sxpIeApkKdvvDEgXoJu/h04UYWT1Mj9wE/T9VkTXGoVglcQe060Zh0TOZvrWT0+Dg 7SOXihefAFtONADZkSnTqM5eB8wQmOMie6Fv6RuzzACHGNdlZS3EwC88IWp/RjZvKacG /VXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=TiJkL+8i; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id e24-v6si23936264pff.30.2018.05.25.14.46.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 14:46:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=TiJkL+8i; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=kB6+E4Xd1Rgo/mRdTC9dDYwAE8zKxpH4xQoQk3lnB9U=; b=TiJ kL+8ipGS1eoAcUyKIYT6DGGgbnkTTFA9iAx5WtI82poO0npXJGSwqwd/BVCjwjcB8CnqG66PcqO8R IPfCwASjG5Sz3gX/vVjryH7IUjsTKoXEJaf2GSwi2jhd7zdgTmzK+unpqC5XYIscd48pvDuWRYrCl NW5CymCyAVgHcXhEO3P51z23M1QfDBBGCCPUWa8qFR/8wLOXy3IA6YzadzPQoQQ/+Pz0qDL9ZvOJk Bi5kFJKsmW4JaUi5WFO9w1EYCjdYWisSfayZYAivivujOQh4fjpLwxyNRDTbNpnCmNqCFlA2z9rnJ aP4bQoLGf8ZH/xlbULLN9SxH5qiIAVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMKXT-0006Ee-UF; Fri, 25 May 2018 21:46:19 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMKXP-0006D5-Le for linux-mtd@lists.infradead.org; Fri, 25 May 2018 21:46:17 +0000 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lm8NJ-1fvfPt3KHh-00Zd3H; Fri, 25 May 2018 23:45:52 +0200 From: Arnd Bergmann To: Al Viro Subject: [PATCH] procfs: use inline functions instead of macros for proc_create_single_data stub Date: Fri, 25 May 2018 23:45:00 +0200 Message-Id: <20180525214548.2122779-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:pjWjjUxM59AzxV4VH5Q5xayjthbeTTq9P5SZXZNErwcBwbJ5cU7 sY/8qrk4dIVJHCcQEeDJL6z2DnqfyPXBiGK8pJWeRZOH7h42O3xyuPDtFOzagmseFQHd1St 0TO9aQOFdE4813KwQYXuEOSLoghFkTZg/aFb/qd1xPG+NDBRGCqBmxfQ7SN5iJPSNSrYDmA bN8TN/KfcY9hI8vcv6dgQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:fBKHoYUNifg=:GwXV8euQVo43dxGT2ra0ws LBxqUKQtIAgZ7kGYn/QMDzFmqSURKCWvmT/uL+/TAOkBgpXWPKg/MSj2ulcyoiSsccwazps9L 1REPxXvASH/nQBSLfPliMxEjSx7MZhoh8DgO27qoK9ObqJeC8DUG6NDGSdo87GdrEOb6GX/pf B/zwRz/rpUy6y2GjRgRgZJUYeVxEt++ldekMMCkF0uJmXhgb/qsTe1pM3nmlvnA5IDcjqfMT4 WDbpXYnnATLK5bXTa6l2tKcHiEPLi4zrxblCU0SmiwrJjGyFaF5+r1n4987mXCCT4u248tv+r 7wiJ2UlWP7P8z6GQdC0yeB3lUpvbbyp0VSanQp2PrBo9m3cWF4d1CpemvTLk3qo3Y6JGfltWL XSnl9nimSxWtxH42K6cCxz2RFTYOC3Bi84ONVbUWLUEG50emx8CQSOvAXeCU1aKBsXT/hY+dd wxGT2560KfhRWZTjbO+A7D3/POxPjPywqKt2YxFHPS8HQhtwDRUS75Ac1cBhF3KdYHTNJjAVa MePSXaQZySBiuoGK/1OdZnaTwSxCHqKV+LmfsSwQTovL6bjEOCx9ixCzV5x+BoV5V5AEFE4xe tEBLcO4/RP4OTbN29KDGevBiuPXGOaY6O/YyT24H2X8xOAhJhp529qve5hPkFWxROti/y6m8N poyy8vukXoQsHO54PHRROSGI4MCBeeP36JN6fpJ/JTgC5p2ma53Wp++0bE9lBgQhCA3k= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180525_144616_013044_1A343F72 X-CRM114-Status: GOOD ( 16.33 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.133 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Boris Brezillon , linux-mtd@lists.infradead.org, Miquel Raynal , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Brian Norris , David Woodhouse , Christoph Hellwig MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The procfs interface changes caused one warning in afs for a now unused function: fs/afs/proc.c:818:12: error: 'afs_proc_stats_show' defined but not used [-Werror=unused-function] static int afs_proc_stats_show(struct seq_file *m, void *v) This can be avoided by using an inline function instead of a macro to reference it, so now the compiler can silently drop the function after seeing that there is a reference but that it is never called. Unfortunately, this change triggers another warning where a function is hidden and now unexpectedly referenced: drivers/mtd/mtdcore.c: In function 'init_mtd': drivers/mtd/mtdcore.c:1878:48: error: 'mtd_proc_show' undeclared (first use in this function); did you mean 'mtd_name_show'? It seems nicer to keep using the inline function and removing the #ifdef here than to add an #ifdef around every single function we pass into proc_create_single_data(), so I'm removing the #ifdef here. After a few hundred randconfig builds, this was the only instance I found that caused a problem. Fixes: 353861cf0594 ("afs: simplify procfs code") Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}") Cc: Christoph Hellwig Signed-off-by: Arnd Bergmann --- drivers/mtd/mtdcore.c | 3 --- include/linux/proc_fs.h | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) -- 2.9.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 42395df06be9..08d1e89faf9c 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -1814,8 +1814,6 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size) } EXPORT_SYMBOL_GPL(mtd_kmalloc_up_to); -#ifdef CONFIG_PROC_FS - /*====================================================================*/ /* Support for /proc/mtd */ @@ -1833,7 +1831,6 @@ static int mtd_proc_show(struct seq_file *m, void *v) mutex_unlock(&mtd_table_mutex); return 0; } -#endif /* CONFIG_PROC_FS */ /*====================================================================*/ /* Init code */ diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e518352137e7..3b44c357a6e7 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -84,8 +84,14 @@ static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, #define proc_create_seq_private(name, mode, parent, ops, size, data) ({NULL;}) #define proc_create_seq_data(name, mode, parent, ops, data) ({NULL;}) #define proc_create_seq(name, mode, parent, ops) ({NULL;}) -#define proc_create_single(name, mode, parent, show) ({NULL;}) -#define proc_create_single_data(name, mode, parent, show, data) ({NULL;}) +static inline struct proc_dir_entry *proc_create_single_data(const char *name, + umode_t mode, struct proc_dir_entry *parent, + int (*show)(struct seq_file *, void *), void *data) +{ + return NULL; +} +#define proc_create_single(name, mode, parent, show) \ + proc_create_single_data(name, mode, parent, show, NULL) #define proc_create(name, mode, parent, proc_fops) ({NULL;}) #define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;})