Skip to content

Commit 54d7a47

Browse files
can: rcar_canfd: add __maybe_unused annotation to silence warning
Since commit | dd3bd23 ("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: ac42240 ("can: rcar: Kconfig: Add helper dependency on COMPILE_TEST") Fixes: dd3bd23 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver") Link: https://lore.kernel.org/all/[email protected] Cc: [email protected] Cc: Cai Huoqing <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent b539c44 commit 54d7a47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ static int __maybe_unused rcar_canfd_resume(struct device *dev)
20172017
static SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend,
20182018
rcar_canfd_resume);
20192019

2020-
static const struct of_device_id rcar_canfd_of_table[] = {
2020+
static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = {
20212021
{ .compatible = "renesas,rcar-gen3-canfd", .data = (void *)RENESAS_RCAR_GEN3 },
20222022
{ .compatible = "renesas,rzg2l-canfd", .data = (void *)RENESAS_RZG2L },
20232023
{ }

0 commit comments

Comments
 (0)