public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: docg3: fix 'defined but not used' warning
@ 2014-10-22 17:23 Brian Norris
  2014-10-22 17:33 ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2014-10-22 17:23 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Norris, Robert Jarzmik

   drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable]
    static struct of_device_id docg3_dt_ids[] = {

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mtd/devices/docg3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index abd94668a05d..0d9d3ee68b61 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -2119,11 +2119,13 @@ static int __exit docg3_release(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
 static struct of_device_id docg3_dt_ids[] = {
 	{ .compatible = "m-systems,diskonchip-g3" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, docg3_dt_ids);
+#endif
 
 static struct platform_driver g3_driver = {
 	.driver		= {
-- 
1.9.1

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

* Re: [PATCH] mtd: docg3: fix 'defined but not used' warning
  2014-10-22 17:23 [PATCH] mtd: docg3: fix 'defined but not used' warning Brian Norris
@ 2014-10-22 17:33 ` Brian Norris
  2014-10-22 19:38   ` Robert Jarzmik
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2014-10-22 17:33 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: Brian Norris, Robert Jarzmik

On Wed, Oct 22, 2014 at 10:23 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
>    drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable]
>     static struct of_device_id docg3_dt_ids[] = {

I suppose I should add that this only happens when CONFIG_OF=n. I'll
add this to the commit message if/when I apply this.

Brian

> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/mtd/devices/docg3.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
> index abd94668a05d..0d9d3ee68b61 100644
> --- a/drivers/mtd/devices/docg3.c
> +++ b/drivers/mtd/devices/docg3.c
> @@ -2119,11 +2119,13 @@ static int __exit docg3_release(struct platform_device *pdev)
>         return 0;
>  }
>
> +#ifdef CONFIG_OF
>  static struct of_device_id docg3_dt_ids[] = {
>         { .compatible = "m-systems,diskonchip-g3" },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, docg3_dt_ids);
> +#endif
>
>  static struct platform_driver g3_driver = {
>         .driver         = {

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

* Re: [PATCH] mtd: docg3: fix 'defined but not used' warning
  2014-10-22 17:33 ` Brian Norris
@ 2014-10-22 19:38   ` Robert Jarzmik
  2014-10-22 21:02     ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Jarzmik @ 2014-10-22 19:38 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd@lists.infradead.org

Brian Norris <computersforpeace@gmail.com> writes:

> On Wed, Oct 22, 2014 at 10:23 AM, Brian Norris
> <computersforpeace@gmail.com> wrote:
>>    drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable]
>>     static struct of_device_id docg3_dt_ids[] = {
>
> I suppose I should add that this only happens when CONFIG_OF=n. I'll
> add this to the commit message if/when I apply this.

Thanks Brian, I had forgotten the non device-tree case, and overviewed the
warning. Your change is the way to go.

Cheers.

--
Robert

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

* Re: [PATCH] mtd: docg3: fix 'defined but not used' warning
  2014-10-22 19:38   ` Robert Jarzmik
@ 2014-10-22 21:02     ` Brian Norris
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2014-10-22 21:02 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: linux-mtd@lists.infradead.org

On Wed, Oct 22, 2014 at 09:38:39PM +0200, Robert Jarzmik wrote:
> Brian Norris <computersforpeace@gmail.com> writes:
> 
> > On Wed, Oct 22, 2014 at 10:23 AM, Brian Norris
> > <computersforpeace@gmail.com> wrote:
> >>    drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable]
> >>     static struct of_device_id docg3_dt_ids[] = {
> >
> > I suppose I should add that this only happens when CONFIG_OF=n. I'll
> > add this to the commit message if/when I apply this.
> 
> Thanks Brian, I had forgotten the non device-tree case, and overviewed the
> warning. Your change is the way to go.

OK, applied to l2-mtd.git.

Brian

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

end of thread, other threads:[~2014-10-22 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 17:23 [PATCH] mtd: docg3: fix 'defined but not used' warning Brian Norris
2014-10-22 17:33 ` Brian Norris
2014-10-22 19:38   ` Robert Jarzmik
2014-10-22 21:02     ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox