diff mbox series

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

Message ID 20191015141945.16067-1-ben.dooks@codethink.co.uk (mailing list archive)
State Mainlined
Commit 09e2a8b78cbd628f4f428b76cb3fed64cdfbc657
Headers show
Series usb: ohci-nxp: fix use of integer as pointer | expand

Commit Message

Ben Dooks Oct. 15, 2019, 2:19 p.m. UTC
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

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/usb/host/ohci-nxp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sylvain Lemieux Oct. 18, 2019, 6:41 p.m. UTC | #1
On Tue, Oct 15, 2019 at 10:19 AM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
> 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
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
[...]

> --- a/drivers/usb/host/ohci-nxp.c
> +++ b/drivers/usb/host/ohci-nxp.c
> @@ -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;
> --
> 2.23.0
>
Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com>
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index c561881d0e79..85878e8ad331 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -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;