All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: YueHaibing <yuehaibing@huawei.com>, <tony@atomide.com>,
	<krzk@kernel.org>
Cc: <linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 -next] memory: omap-gpmc: Fix -Wunused-function warnings
Date: Tue, 1 Sep 2020 14:14:46 +0300	[thread overview]
Message-ID: <23ba6576-1f07-e60e-76f8-e48808f8d42b@ti.com> (raw)
In-Reply-To: <20200901070945.23792-1-yuehaibing@huawei.com>

Hi,

On 01/09/2020 10:09, YueHaibing wrote:
> If CONFIG_OF is not set, make W=1 warns:
> 
> drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function]
>   static int gpmc_cs_remap(int cs, u32 base)
>              ^~~~~~~~~~~~~
> drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function]
>   static const char *gpmc_cs_get_name(int cs)
>                      ^~~~~~~~~~~~~~~~
> drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function]
>   static void gpmc_cs_set_name(int cs, const char *name)
>               ^~~~~~~~~~~~~~~~
> Make them as  __maybe_unused to fix this.

Instead of that how about moving those 3 functions to within
#ifdef CONFIG_OF
#endif

like gpmc_probe_generic_child()

We are absolutely sure they are not required if CONFIG_OF isn't defined.

cheers,
-roger

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: update commit log
> ---
>   drivers/memory/omap-gpmc.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index ac0f577a51a1..24372254986e 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -916,14 +916,14 @@ static bool gpmc_cs_reserved(int cs)
>   	return gpmc->flags & GPMC_CS_RESERVED;
>   }
>   
> -static void gpmc_cs_set_name(int cs, const char *name)
> +static void __maybe_unused gpmc_cs_set_name(int cs, const char *name)
>   {
>   	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
>   
>   	gpmc->name = name;
>   }
>   
> -static const char *gpmc_cs_get_name(int cs)
> +static const __maybe_unused char *gpmc_cs_get_name(int cs)
>   {
>   	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
>   
> @@ -984,7 +984,7 @@ static int gpmc_cs_delete_mem(int cs)
>    * "base". Returns 0 on success and appropriate negative error code
>    * on failure.
>    */
> -static int gpmc_cs_remap(int cs, u32 base)
> +static int __maybe_unused gpmc_cs_remap(int cs, u32 base)
>   {
>   	int ret;
>   	u32 old_base, size;
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2020-09-01 11:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  3:56 [PATCH -next] memory: omap-gpmc: Fix -Wunused-function warnings YueHaibing
2020-09-01  6:52 ` Krzysztof Kozlowski
2020-09-01  6:58   ` Yuehaibing
2020-09-01  7:07 ` YueHaibing
2020-09-01  7:11   ` Yuehaibing
2020-09-01  7:09 ` [PATCH v2 " YueHaibing
2020-09-01 11:14   ` Roger Quadros [this message]
2020-09-01 11:28 ` [PATCH v3 " YueHaibing
2020-09-01 12:11   ` Roger Quadros
2020-09-02 15:29   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23ba6576-1f07-e60e-76f8-e48808f8d42b@ti.com \
    --to=rogerq@ti.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.