Browse Source

USB: fix coccinelle warnings

drivers/usb/host/ehci-mv.c:181:26-27: WARNING comparing pointer to 0, suggest !E
/c/kernel-tests/src/cocci/drivers/usb/host/ehci-mv.c:181:26-27: WARNING comparing pointer to 0

 Compare pointer-typed values to NULL rather than 0

Semantic patch information:
 This makes an effort to choose between !x and x == NULL.  !x is used
 if it has previously been used with the function used to initialize x.
 This relies on type information.  More type information can be obtained
 using the option -all_includes and the option -I to specify an
 include path.

Generated by: coccinelle/null/badzero.cocci

CC: Jingoo Han <jg1.han@samsung.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Fengguang Wu 11 years ago
parent
commit
2e30d14f12
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/host/ehci-mv.c

+ 1 - 1
drivers/usb/host/ehci-mv.c

@@ -178,7 +178,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
 
 
 	ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,
 	ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,
 					 resource_size(r));
 					 resource_size(r));
-	if (ehci_mv->phy_regs == 0) {
+	if (!ehci_mv->phy_regs) {
 		dev_err(&pdev->dev, "failed to map phy I/O memory\n");
 		dev_err(&pdev->dev, "failed to map phy I/O memory\n");
 		retval = -EFAULT;
 		retval = -EFAULT;
 		goto err_put_hcd;
 		goto err_put_hcd;