Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1321528

Re: [PATCH] pinctrl: nomadik: hide unused functions

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] pinctrl: nomadik: hide unused functions
Date Fri, 29 Jan 2016 08:40:02 +0100
Message-ID <qWbOW-7Sl-5@gated-at.bofh.it> (permalink)
References <qURSj-6uy-39@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.5.23 (2014-03-12)
X-Sa-Exim-Connect-IP 2001:67c:670:100:1d::c0
X-Sa-Exim-Mail-From ukl@pengutronix.de
X-Sa-Exim-Scanned No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-Ptx-Original-Recipient linux-kernel@vger.kernel.org
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 26
Organization linux.* mail to news gateway
X-Original-Cc Linus Walleij <linus.walleij@linaro.org>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alessandro Rubini <rubini@unipv.it>
X-Original-Date Fri, 29 Jan 2016 08:30:42 +0100
X-Original-Message-ID <20160129073042.GL13664@pengutronix.de>
X-Original-References <1453737557-1960171-1-git-send-email-arnd@arndb.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1321528

Show key headers only | View raw


Hello Arnd,

On Mon, Jan 25, 2016 at 04:59:09PM +0100, Arnd Bergmann wrote:
> The nomadik pinctrl driver has two functions that are only used
> for debugfs output and are otherwise unused:
> 
> drivers/pinctrl/nomadik/pinctrl-abx500.c:194:12: error: 'abx500_get_pull_updown' defined but not used
> drivers/pinctrl/nomadik/pinctrl-abx500.c:471:12: error: 'abx500_get_mode' defined but not used
> 
> This makes the function definitions conditional to avoid the
> harmless warnings.
> [...]
> +#ifdef CONFIG_DEBUG_FS
>  static int abx500_get_pull_updown(struct abx500_pinctrl *pct, int offset,
>  				  enum abx500_gpio_pull_updown *pull_updown)

an alternative is to mark the functions with __maybe_unused. I just
noticed that Documentation/CodingStyle even mandates to use that instead
of cpp stuff.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] pinctrl: nomadik: hide unused functions Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2016-01-29 08:40 +0100

csiph-web