driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: rkvdec: silence ktest bot build warning
@ 2020-12-08 15:55 Adrian Ratiu
  2021-01-07  9:13 ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Ratiu @ 2020-12-08 15:55 UTC (permalink / raw)
  To: linux-media
  Cc: devel, Mauro Carvalho Chehab, linux-kernel, linux-rockchip,
	Boris Brezillon, kernel, Ezequiel Garcia

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.

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@collabora.com>
Cc: Ezequiel Garcia <ezequiel@collabora.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@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 */ }
 };
-- 
2.29.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] media: rkvdec: silence ktest bot build warning
  2020-12-08 15:55 [PATCH] media: rkvdec: silence ktest bot build warning Adrian Ratiu
@ 2021-01-07  9:13 ` Hans Verkuil
  2021-01-07 11:41   ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2021-01-07  9:13 UTC (permalink / raw)
  To: Adrian Ratiu, linux-media
  Cc: devel, Mauro Carvalho Chehab, linux-kernel, linux-rockchip,
	Boris Brezillon, kernel, Ezequiel Garcia

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@collabora.com>
> Cc: Ezequiel Garcia <ezequiel@collabora.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@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 */ }
>  };
> 

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] media: rkvdec: silence ktest bot build warning
  2021-01-07  9:13 ` Hans Verkuil
@ 2021-01-07 11:41   ` Boris Brezillon
  2021-01-07 12:32     ` Ezequiel Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Brezillon @ 2021-01-07 11:41 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: devel, Mauro Carvalho Chehab, Adrian Ratiu, linux-kernel,
	linux-rockchip, kernel, Ezequiel Garcia, linux-media

On Thu, 7 Jan 2021 10:13:43 +0100
Hans Verkuil <hverkuil@xs4all.nl> wrote:

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

It's not uncommon to do that, especially when you want the driver to be
compile-tested (`git grep -C2 __maybe_unused|grep of_device_id` even
reports 2 drivers in the media tree :P). A `depends on OF` or an
`#ifdef CONFIG_OF` section surrounding the of_rkvdec_match declaration
would also do the trick.

> 
> 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@collabora.com>
> > Cc: Ezequiel Garcia <ezequiel@collabora.com>
> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Adrian Ratiu <adrian.ratiu@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 */ }
> >  };
> >   
> 

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] media: rkvdec: silence ktest bot build warning
  2021-01-07 11:41   ` Boris Brezillon
@ 2021-01-07 12:32     ` Ezequiel Garcia
  0 siblings, 0 replies; 4+ messages in thread
From: Ezequiel Garcia @ 2021-01-07 12:32 UTC (permalink / raw)
  To: Boris Brezillon, Hans Verkuil
  Cc: devel, Mauro Carvalho Chehab, Adrian Ratiu, linux-kernel,
	linux-rockchip, kernel, linux-media

On Thu, 2021-01-07 at 12:41 +0100, Boris Brezillon wrote:
> On Thu, 7 Jan 2021 10:13:43 +0100
> Hans Verkuil <hverkuil@xs4all.nl> wrote:
> 
> > 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.
> 
> It's not uncommon to do that, especially when you want the driver to be
> compile-tested (`git grep -C2 __maybe_unused|grep of_device_id` even
> reports 2 drivers in the media tree :P). A `depends on OF` or an
> `#ifdef CONFIG_OF` section surrounding the of_rkvdec_match declaration
> would also do the trick.
> 

I'm fine either way, __maybe_unused or depends on OF.

Thanks,
Ezequiel

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2021-01-07 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 15:55 [PATCH] media: rkvdec: silence ktest bot build warning Adrian Ratiu
2021-01-07  9:13 ` Hans Verkuil
2021-01-07 11:41   ` Boris Brezillon
2021-01-07 12:32     ` Ezequiel Garcia

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