mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
	Arnd Bergmann <arnd@arndb.de>, Greg KH <greg@kroah.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled
Date: Tue, 2 Oct 2018 12:49:55 +0100	[thread overview]
Message-ID: <13b4b871-8f81-d007-ef37-eb697f984f01@linaro.org> (raw)
In-Reply-To: <20181002110246.3175-1-brgl@bgdev.pl>



On 02/10/18 12:02, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> The following warning is produced when building nvmem core if
> CONFIG_OF is disabled:
> 
> drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
>   nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
>   ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> This is caused by the fact that the only caller of this routine is
> under an ifdef depending on this option. Fix it by adding a relevant
> ifdef to the function in question as well.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>   drivers/nvmem/core.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index cc815bb2eebd..65f61cd0a687 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem)
>   	return rval;
>   }
>   
> +#if IS_ENABLED(CONFIG_OF)

You should probably attribute the function with "__maybe_unused"
Instead of adding this condition.

--srini


>   static struct nvmem_cell *
>   nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
>   {
> @@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
>   
>   	return cell;
>   }
> +#endif
>   
>   static struct nvmem_cell *
>   nvmem_find_cell_by_name(struct nvmem_device *nvmem, const char *cell_id)
> 

  reply	other threads:[~2018-10-02 11:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 11:02 Bartosz Golaszewski
2018-10-02 11:49 ` Srinivas Kandagatla [this message]
2018-10-02 11:59   ` Bartosz Golaszewski
2018-10-02 22:26 ` Greg KH
2018-10-03  7:19   ` Bartosz Golaszewski

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=13b4b871-8f81-d007-ef37-eb697f984f01@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=greg@kroah.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®