Skip to contentSkip to conversation

mtd: docg3: fix 'defined but not used' warning

PATCH In review Brian Norris 2 participants 4 messages Oct 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: docg3: fix 'defined but not used' warning

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[] = {
Cc Robert Jarzmik <[email protected]>
---
 drivers/mtd/devices/docg3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/devices/docg3.c +2 -0
index abd94668a05d..0d9d3ee68b61 100644
@@ -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		= {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Brian Norris

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

Quoted 24 lines
Cc Robert Jarzmik <[email protected]>
---
 drivers/mtd/devices/docg3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/devices/docg3.c +2 -0
index abd94668a05d..0d9d3ee68b61 100644
@@ -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         = {
maintainer
#2 lore raw
Quoted 7 lines · Brian Norris
Quoted 2 lines · Brian Norris

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

#3 lore raw
Quoted 4 lines · Robert Jarzmik
Quoted 2 lines · Brian Norris

On Wed, Oct 22, 2014 at 10:23 AM, Brian Norris
<[email protected]> wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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