linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] can: rcar_canfd: add __maybe_unused annotation to silence warning
@ 2021-09-07  6:45 Marc Kleine-Budde
  2021-09-07  7:09 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2021-09-07  6:45 UTC (permalink / raw)
  To: linux-can
  Cc: Marc Kleine-Budde, linux-renesas-soc, Cai Huoqing, kernel test robot

Since commit

| dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")

the rcar_canfd driver can be compile tested on all architectures. On
non OF enabled archs, or archs where OF is optional (and disabled in
the .config) the compilation throws the following warning:

| drivers/net/can/rcar/rcar_canfd.c:2020:34: warning: unused variable 'rcar_canfd_of_table' [-Wunused-const-variable]
| static const struct of_device_id rcar_canfd_of_table[] = {
|                                  ^

This patch fixes the warning by marking the variable
rcar_canfd_of_table as __maybe_unused.

Fixes: ac4224087312 ("can: rcar: Kconfig: Add helper dependency on COMPILE_TEST")
Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")
Cc: linux-renesas-soc@vger.kernel.org
Cc: Cai Huoqing <caihuoqing@baidu.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---

Changes since v1:
- moved __maybe_unused in front after "static const"

 drivers/net/can/rcar/rcar_canfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index c47988d3674e..ff9d0f5ae0dd 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -2017,7 +2017,7 @@ static int __maybe_unused rcar_canfd_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend,
 			 rcar_canfd_resume);
 
-static const struct of_device_id rcar_canfd_of_table[] = {
+static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = {
 	{ .compatible = "renesas,rcar-gen3-canfd", .data = (void *)RENESAS_RCAR_GEN3 },
 	{ .compatible = "renesas,rzg2l-canfd", .data = (void *)RENESAS_RZG2L },
 	{ }
-- 
2.33.0



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

* Re: [PATCH v2] can: rcar_canfd: add __maybe_unused annotation to silence warning
  2021-09-07  6:45 [PATCH v2] can: rcar_canfd: add __maybe_unused annotation to silence warning Marc Kleine-Budde
@ 2021-09-07  7:09 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-09-07  7:09 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: linux-can, Linux-Renesas, Cai Huoqing, kernel test robot

On Tue, Sep 7, 2021 at 8:48 AM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> Since commit
>
> | dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")
>
> the rcar_canfd driver can be compile tested on all architectures. On
> non OF enabled archs, or archs where OF is optional (and disabled in
> the .config) the compilation throws the following warning:
>
> | drivers/net/can/rcar/rcar_canfd.c:2020:34: warning: unused variable 'rcar_canfd_of_table' [-Wunused-const-variable]
> | static const struct of_device_id rcar_canfd_of_table[] = {
> |                                  ^
>
> This patch fixes the warning by marking the variable
> rcar_canfd_of_table as __maybe_unused.
>
> Fixes: ac4224087312 ("can: rcar: Kconfig: Add helper dependency on COMPILE_TEST")
> Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Cai Huoqing <caihuoqing@baidu.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2021-09-07  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  6:45 [PATCH v2] can: rcar_canfd: add __maybe_unused annotation to silence warning Marc Kleine-Budde
2021-09-07  7:09 ` Geert Uytterhoeven

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