linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: ams-delta: Fix non-OF build warning
@ 2020-09-19  8:04 Janusz Krzysztofik
  2020-09-28 14:59 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Janusz Krzysztofik @ 2020-09-19  8:04 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Nathan Chancellor,
	Nick Desaulniers, linux-mtd, clang-built-linux, linux-kernel,
	Janusz Krzysztofik, kernel test robot

Commit 7c2f66a960fc ("mtd: rawnand: ams-delta: Add module device
tables") introduced an OF module device table but wrapped a reference
to it with of_match_ptr() which resolves to NULL in non-OF configs.
That resulted in a clang compiler warning on unused variable in non-OF
builds.  Fix it.

drivers/mtd/nand/raw/ams-delta.c:373:34: warning: unused variable 'gpio_nand_of_id_table' [-Wunused-const-variable]
   static const struct of_device_id gpio_nand_of_id_table[] = {
                                    ^
   1 warning generated.

Fixes: 7c2f66a960fc ("mtd: rawnand: ams-delta: Add module device tables")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
 drivers/mtd/nand/raw/ams-delta.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c
index fdba155416d2..0bf4cfc25147 100644
--- a/drivers/mtd/nand/raw/ams-delta.c
+++ b/drivers/mtd/nand/raw/ams-delta.c
@@ -400,12 +400,14 @@ static int gpio_nand_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id gpio_nand_of_id_table[] = {
 	{
 		/* sentinel */
 	},
 };
 MODULE_DEVICE_TABLE(of, gpio_nand_of_id_table);
+#endif
 
 static const struct platform_device_id gpio_nand_plat_id_table[] = {
 	{
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: rawnand: ams-delta: Fix non-OF build warning
  2020-09-19  8:04 [PATCH] mtd: rawnand: ams-delta: Fix non-OF build warning Janusz Krzysztofik
@ 2020-09-28 14:59 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2020-09-28 14:59 UTC (permalink / raw)
  To: Janusz Krzysztofik, Miquel Raynal
  Cc: Vignesh Raghavendra, Richard Weinberger, Nick Desaulniers,
	linux-kernel, clang-built-linux, linux-mtd, Nathan Chancellor,
	kernel test robot

On Sat, 2020-09-19 at 08:04:03 UTC, Janusz Krzysztofik wrote:
> Commit 7c2f66a960fc ("mtd: rawnand: ams-delta: Add module device
> tables") introduced an OF module device table but wrapped a reference
> to it with of_match_ptr() which resolves to NULL in non-OF configs.
> That resulted in a clang compiler warning on unused variable in non-OF
> builds.  Fix it.
> 
> drivers/mtd/nand/raw/ams-delta.c:373:34: warning: unused variable 'gpio_nand_of_id_table' [-Wunused-const-variable]
>    static const struct of_device_id gpio_nand_of_id_table[] = {
>                                     ^
>    1 warning generated.
> 
> Fixes: 7c2f66a960fc ("mtd: rawnand: ams-delta: Add module device tables")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-28 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19  8:04 [PATCH] mtd: rawnand: ams-delta: Fix non-OF build warning Janusz Krzysztofik
2020-09-28 14:59 ` Miquel Raynal

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).