Skip to contentSkip to conversation

usb: gadget: udc: pxa27x: fix build warning when !OF

PATCH New Felipe Balbi 3 participants 6 messages Nov 6, 2014 – Nov 7, 2014

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

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL.

Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning.

drivers/usb/gadget/udc/pxa27x_udc.c:2403:28: warning: ?udc_pxa_dt_ids? defined but not used [-Wunused-variable]

 static struct of_device_id udc_pxa_dt_ids[] = {
                            ^
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/pxa27x_udc.c +1 -1
index 69e7b816..d1d8a9f 100644
@@ -2590,7 +2590,7 @@ static struct platform_driver udc_driver = {
 	.driver		= {
 		.name	= "pxa27x-udc",
 		.owner	= THIS_MODULE,
-		.of_match_table = of_match_ptr(udc_pxa_dt_ids),
+		.of_match_table = udc_pxa_dt_ids,
 	},
 	.probe		= pxa_udc_probe,
 	.remove		= pxa_udc_remove,
Signature · 1 line
2.1.0.GIT
maintainer
#1 lore raw

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

Quoted 6 lines · Felipe Balbi

in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL.

Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning.

The alternative, of course, would be to wrap the udc_pxa_dt_ids declaration in IS_ENABLED(CONFIG_OF), but I'm not sure whether it's worth it.

Daniel

Quoted 22 lines

drivers/usb/gadget/udc/pxa27x_udc.c:2403:28: warning: ?udc_pxa_dt_ids? defined but not used [-Wunused-variable]

 static struct of_device_id udc_pxa_dt_ids[] = {
                            ^
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/pxa27x_udc.c +1 -1
index 69e7b816..d1d8a9f 100644
@@ -2590,7 +2590,7 @@ static struct platform_driver udc_driver = {
 	.driver		= {
 		.name	= "pxa27x-udc",
 		.owner	= THIS_MODULE,
-		.of_match_table = of_match_ptr(udc_pxa_dt_ids),
+		.of_match_table = udc_pxa_dt_ids,
 	},
 	.probe		= pxa_udc_probe,
 	.remove		= pxa_udc_remove,
maintainer
#2 lore raw

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

Quoted 11 lines · Daniel Mack
Quoted 6 lines · Felipe Balbi

in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL.

Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning.

The alternative, of course, would be to wrap the udc_pxa_dt_ids declaration in IS_ENABLED(CONFIG_OF), but I'm not sure whether it's worth it.

Ah, wasn't the patch named "[PATCH v1] usb: gadget: pxa27x_udc: fix warning in non device-tree build" sent October the 29th fixing this issue (in [1]) ?

Cheers.

--
Robert

[1] Patch
From: Robert Jarzmik <[email protected]>
Subject: [PATCH v1] usb: gadget: pxa27x_udc: fix warning in non device-tree build
To: Felipe Balbi <[email protected]>
Cc: linux-usb at vger.kernel.org, Robert Jarzmik <[email protected]>
Date: Wed, 29 Oct 2014 21:58:33 +0100 (1 week, 22 hours, 56 minutes ago)
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.1.0

The recent change bringing device-tree support triggers a warning in a non device-tree build :
drivers/usb/gadget/udc/pxa27x_udc.c:2405:28: warning: 'udc_pxa_dt_ids' defined but not used [-Wunused-variable]

Fix the warning with a preprocessor condition.

---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/udc/pxa27x_udc.c +2 -0
index 69e7b816..9b03fab 100644
@@ -2400,11 +2400,13 @@ static struct pxa_udc memory = {
 	}
 };
 
+#if defined(CONFIG_OF)
 static struct of_device_id udc_pxa_dt_ids[] = {
 	{ .compatible = "marvell,pxa270-udc" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids);
+#endif
 
 /**
  * pxa_udc_probe - probes the udc device
Signature · 1 line
2.1.0
#3 lore raw

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

Hi,

Quoted 10 lines · Robert Jarzmik
Quoted 8 lines · Daniel Mack
Quoted 6 lines · Felipe Balbi

in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL.

Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning.

Quoted 7 lines
Quoted 3 lines

The alternative, of course, would be to wrap the udc_pxa_dt_ids declaration in IS_ENABLED(CONFIG_OF), but I'm not sure whether it's worth it.

Ah, wasn't the patch named "[PATCH v1] usb: gadget: pxa27x_udc: fix warning in non device-tree build" sent October the 29th fixing this issue (in [1]) ?

I seem to have missed that, let me replace the patches and use yours.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141106/64c867f2/attachment.sig>
#4 lore raw

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

Quoted 17 lines · Felipe Balbi

Hi,

Quoted 14 lines · Robert Jarzmik
Quoted 11 lines · Daniel Mack
Quoted 6 lines · Felipe Balbi

in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL.

Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning.

The alternative, of course, would be to wrap the udc_pxa_dt_ids declaration in IS_ENABLED(CONFIG_OF), but I'm not sure whether it's worth it.

Quoted 5 lines
Quoted 3 lines

Ah, wasn't the patch named "[PATCH v1] usb: gadget: pxa27x_udc: fix warning in non device-tree build" sent October the 29th fixing this issue (in [1]) ?

I seem to have missed that, let me replace the patches and use yours.

now done.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141106/3ff76046/attachment.sig>
maintainer
#5 lore raw

PATCH 1/1 usb: gadget: udc: pxa27x: fix build warning when !OF

Quoted 4 lines · Felipe Balbi
Quoted 1 line · Felipe Balbi

I seem to have missed that, let me replace the patches and use yours.

now done.

Thanks.

Signature · 1 line
Robert