Skip to contentSkip to conversation

usb: phy: fsl-usb: use NULL instead of plain integer 0

PATCH New Felix Huang 2 participants 2 messages Nov 28

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

PATCH 1/1 usb: phy: fsl-usb: use NULL instead of plain integer 0

Fix the following sparse warning in fsl_otg_set_peripheral():

drivers/usb/phy/phy-fsl-usb.c:618:31: warning: Using plain integer as NULL pointer

Assign NULL instead of 0 to the struct usb_gadget pointer otg->gadget.

---
 drivers/usb/phy/phy-fsl-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-fsl-usb.c +1 -1
index 1986f7e9d..110b277aa 100644
@@ -615,7 +615,7 @@ static int fsl_otg_set_peripheral(struct usb_otg *otg,
 		if (!otg->default_a)
 			otg->gadget->ops->vbus_draw(otg->gadget, 0);
 		usb_gadget_vbus_disconnect(otg->gadget);
-		otg->gadget = 0;
+		otg->gadget = NULL;
 		otg_dev->fsm.b_bus_req = 0;
 		otg_statemachine(&otg_dev->fsm);
 		return 0;

---
base-commit: f4585067150b85e33f60876149a6e742928da75e
change-id: 20261127-fsl-usb-null-pointer-fbb14806a3b0

Best regards,

Signature · 1 line
Felix Huang <[email protected]>
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

From: Felix Huang <[email protected]>

Fix the following sparse warning in fsl_otg_set_peripheral():

drivers/usb/phy/phy-fsl-usb.c:618:31: warning: Using plain integer as NULL pointer

Assign NULL instead of 0 to the struct usb_gadget pointer otg->gadget.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1