All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Adrian Ratiu <adrian.ratiu@collabora.com>,
	linux-media@vger.kernel.org, kernel@collabora.com,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] media: rkvdec: silence ktest bot build warning
Date: Thu, 7 Jan 2021 12:41:32 +0100	[thread overview]
Message-ID: <20210107124132.3648e789@collabora.com> (raw)
In-Reply-To: <76b5569c-bc19-3d11-4da7-cf0dbb244433@xs4all.nl>

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 */ }
> >  };
> >   
> 


WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: devel@driverdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Adrian Ratiu <adrian.ratiu@collabora.com>,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	kernel@collabora.com, Ezequiel Garcia <ezequiel@collabora.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] media: rkvdec: silence ktest bot build warning
Date: Thu, 7 Jan 2021 12:41:32 +0100	[thread overview]
Message-ID: <20210107124132.3648e789@collabora.com> (raw)
In-Reply-To: <76b5569c-bc19-3d11-4da7-cf0dbb244433@xs4all.nl>

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

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: devel@driverdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	kernel test robot <lkp@intel.com>,
	Adrian Ratiu <adrian.ratiu@collabora.com>,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	kernel@collabora.com, Ezequiel Garcia <ezequiel@collabora.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] media: rkvdec: silence ktest bot build warning
Date: Thu, 7 Jan 2021 12:41:32 +0100	[thread overview]
Message-ID: <20210107124132.3648e789@collabora.com> (raw)
In-Reply-To: <76b5569c-bc19-3d11-4da7-cf0dbb244433@xs4all.nl>

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 */ }
> >  };
> >   
> 


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2021-01-07 11:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 15:55 [PATCH] media: rkvdec: silence ktest bot build warning Adrian Ratiu
2020-12-08 15:55 ` Adrian Ratiu
2020-12-08 15:55 ` Adrian Ratiu
2021-01-07  9:13 ` Hans Verkuil
2021-01-07  9:13   ` Hans Verkuil
2021-01-07  9:13   ` Hans Verkuil
2021-01-07 11:41   ` Boris Brezillon [this message]
2021-01-07 11:41     ` Boris Brezillon
2021-01-07 11:41     ` Boris Brezillon
2021-01-07 12:32     ` Ezequiel Garcia
2021-01-07 12:32       ` Ezequiel Garcia
2021-01-07 12:32       ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107124132.3648e789@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.ratiu@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.