Skip to contentSkip to conversation

phy: broadcom: phy-brcm-usb-init.c: Fix comparing pointer to 0

PATCH In review Saurav Girepunje 2 participants 2 messages Oct 28, 2019 – Oct 30, 2019

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

PATCH 1/1 phy: broadcom: phy-brcm-usb-init.c: Fix comparing pointer to 0

Compare pointer-typed values to NULL rather than 0

---
 drivers/phy/broadcom/phy-brcm-usb-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/broadcom/phy-brcm-usb-init.c +1 -1
index 3c53625f8bc2..2ea1e84b544b 100644
@@ -707,7 +707,7 @@ static void brcmusb_usb3_otp_fix(struct brcm_usb_init_params *params)
 	void __iomem *xhci_ec_base = params->xhci_ec_regs;
 	u32 val;
 
-	if (params->family_id != 0x74371000 || xhci_ec_base == 0)
+	if (params->family_id != 0x74371000 || xhci_ec_base == NULL)
 		return;
 	brcmusb_writel(0xa20c, USB_XHCI_EC_REG(xhci_ec_base, IRAADR));
 	val = brcmusb_readl(USB_XHCI_EC_REG(xhci_ec_base, IRADAT));
Signature · 1 line
2.20.1
#1 lore raw

Hi,

Quoted 3 lines · Saurav Girepunje

Compare pointer-typed values to NULL rather than 0

I've already merged a patch by Ben Dooks for fixing this
https://lore.kernel.org/r/[email protected]

Thanks
Kishon

Quoted 18 lines
---
 drivers/phy/broadcom/phy-brcm-usb-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/broadcom/phy-brcm-usb-init.c +1 -1
index 3c53625f8bc2..2ea1e84b544b 100644
@@ -707,7 +707,7 @@ static void brcmusb_usb3_otp_fix(struct brcm_usb_init_params *params)
 	void __iomem *xhci_ec_base = params->xhci_ec_regs;
 	u32 val;
 
-	if (params->family_id != 0x74371000 || xhci_ec_base == 0)
+	if (params->family_id != 0x74371000 || xhci_ec_base == NULL)
 		return;
 	brcmusb_writel(0xa20c, USB_XHCI_EC_REG(xhci_ec_base, IRAADR));
 	val = brcmusb_readl(USB_XHCI_EC_REG(xhci_ec_base, IRADAT));