From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
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: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled
Date: Tue, 2 Oct 2018 13:02:46 +0200 [thread overview]
Message-ID: <20181002110246.3175-1-brgl@bgdev.pl> (raw)
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)
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)
--
2.19.0
next reply other threads:[~2018-10-02 11:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 11:02 Bartosz Golaszewski [this message]
2018-10-02 11:49 ` [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled Srinivas Kandagatla
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=20181002110246.3175-1-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=arnd@arndb.de \
--cc=bgolaszewski@baylibre.com \
--cc=greg@kroah.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=srinivas.kandagatla@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).