[PATCH] media: rkvdec: silence ktest bot build warning

Hans Verkuil hverkuil at xs4all.nl
Thu Jan 7 04:13:43 EST 2021


On 08/12/2020 16:55, Adrian Ratiu wrote:
> Some configurations built by the ktest bot produce the following
> warn, so mark the struct as __maybe_unused to avoid unnecessary
> ML spam.
> 
>>> drivers/staging/media/rkvdec/rkvdec.c:967:34: warning: unused variable 'of_rkvdec_match' [-Wunused-const-variable]
>    static const struct of_device_id of_rkvdec_match[] = {
> 				    ^
>    1 warning generated.

I suspect that this is because there is no 'depends on OF' in the Kconfig.

'__maybe_unused' isn't used for this anywhere else, so this does not seem like the
right approach.

Regards,

	Hans

> 
> vim +/of_rkvdec_match +967 drivers/staging/media/rkvdec/rkvdec.c
> 
>    966
>  > 967	static const struct of_device_id of_rkvdec_match[] = {
>    968		{ .compatible = "rockchip,rk3399-vdec" },
>    969		{ /* sentinel */ }
>    970	};
>    971	MODULE_DEVICE_TABLE(of, of_rkvdec_match);
>    972
> 
> Cc: Boris Brezillon <boris.brezillon at collabora.com>
> Cc: Ezequiel Garcia <ezequiel at collabora.com>
> Cc: Mauro Carvalho Chehab <mchehab at kernel.org>
> Reported-by: kernel test robot <lkp at intel.com>
> Signed-off-by: Adrian Ratiu <adrian.ratiu at collabora.com>
> ---
>  drivers/staging/media/rkvdec/rkvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
> index aa4f8c287618..3af0f02ec59b 100644
> --- a/drivers/staging/media/rkvdec/rkvdec.c
> +++ b/drivers/staging/media/rkvdec/rkvdec.c
> @@ -992,7 +992,7 @@ static void rkvdec_watchdog_func(struct work_struct *work)
>  	}
>  }
>  
> -static const struct of_device_id of_rkvdec_match[] = {
> +static const struct of_device_id __maybe_unused of_rkvdec_match[] = {
>  	{ .compatible = "rockchip,rk3399-vdec" },
>  	{ /* sentinel */ }
>  };
> 




More information about the Linux-rockchip mailing list