Skip to contentSkip to conversation

usb: ohci-nxp: fix use of integer as pointer

PATCH In review Ben Dooks 2 participants 2 messages Oct 15, 2019 – Oct 18, 2019

Subsystems (3)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 usb: ohci-nxp: fix use of integer as pointer

The hcd pointer in ohci_hcd_nxp_probe() is being initialised with a 0, so fix to NULL to avoid the following sparse warning:

drivers/usb/host/ohci-nxp.c:153:31: warning: Using plain integer as NULL pointer

---
Cc: Vladimir Zapolskiy <[email protected]>
Cc: Sylvain Lemieux <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/usb/host/ohci-nxp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-nxp.c +1 -1
index c561881d0e79..85878e8ad331 100644
@@ -150,7 +150,7 @@ static void ohci_nxp_stop_hc(void)
 
 static int ohci_hcd_nxp_probe(struct platform_device *pdev)
 {
-	struct usb_hcd *hcd = 0;
+	struct usb_hcd *hcd = NULL;
 	const struct hc_driver *driver = &ohci_nxp_hc_driver;
 	struct resource *res;
 	int ret = 0, irq;
Signature · 1 line
2.23.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ben Dooks

The hcd pointer in ohci_hcd_nxp_probe() is
being initialised with a 0, so fix to NULL to
avoid the following sparse warning:

drivers/usb/host/ohci-nxp.c:153:31: warning: Using plain integer as NULL pointer

---

[...]

Quoted 12 lines
drivers/usb/host/ohci-nxp.c +1 -2
@@ -150,7 +150,7 @@ static void ohci_nxp_stop_hc(void)
 
 static int ohci_hcd_nxp_probe(struct platform_device *pdev)
 {
-       struct usb_hcd *hcd = 0;
+       struct usb_hcd *hcd = NULL;
        const struct hc_driver *driver = &ohci_nxp_hc_driver;
        struct resource *res;
        int ret = 0, irq;
--
Quoted 2 lines

2.23.0