2020-08-28 08:53:37

by Lee Jones

[permalink] [raw]
Subject: [PATCH 1/1] mfd: khadas-mcu: Fix randconfig 'unused-const-variable' warning

When testing with !OF, the build system reports:

>> drivers/mfd/khadas-mcu.c:125:34: warning: unused variable 'khadas_mcu_of_match' [-Wunused-const-variable]
static const struct of_device_id khadas_mcu_of_match[] = {
^

Cc: Neil Armstrong <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/mfd/khadas-mcu.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/khadas-mcu.c b/drivers/mfd/khadas-mcu.c
index 44d5bb462daba..f3d418810693c 100644
--- a/drivers/mfd/khadas-mcu.c
+++ b/drivers/mfd/khadas-mcu.c
@@ -122,11 +122,13 @@ static int khadas_mcu_probe(struct i2c_client *client,
return 0;
}

+#ifdef CONFIG_OF
static const struct of_device_id khadas_mcu_of_match[] = {
{ .compatible = "khadas,mcu", },
{},
};
MODULE_DEVICE_TABLE(of, khadas_mcu_of_match);
+#endif

static struct i2c_driver khadas_mcu_driver = {
.driver = {
--
2.25.1


2020-08-28 09:22:25

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/1] mfd: khadas-mcu: Fix randconfig 'unused-const-variable' warning

Hi Lee,

On 28/08/2020 10:50, Lee Jones wrote:
> When testing with !OF, the build system reports:
>
>>> drivers/mfd/khadas-mcu.c:125:34: warning: unused variable 'khadas_mcu_of_match' [-Wunused-const-variable]
> static const struct of_device_id khadas_mcu_of_match[] = {
> ^
>
> Cc: Neil Armstrong <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/mfd/khadas-mcu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mfd/khadas-mcu.c b/drivers/mfd/khadas-mcu.c
> index 44d5bb462daba..f3d418810693c 100644
> --- a/drivers/mfd/khadas-mcu.c
> +++ b/drivers/mfd/khadas-mcu.c
> @@ -122,11 +122,13 @@ static int khadas_mcu_probe(struct i2c_client *client,
> return 0;
> }
>
> +#ifdef CONFIG_OF
> static const struct of_device_id khadas_mcu_of_match[] = {
> { .compatible = "khadas,mcu", },
> {},
> };
> MODULE_DEVICE_TABLE(of, khadas_mcu_of_match);
> +#endif
>
> static struct i2c_driver khadas_mcu_driver = {
> .driver = {
>
Thanks for the patch,

Acked-by: Neil Armstrong <[email protected]>