Skip to contentSkip to conversation

Usb: core: Correct self assignment in phy.c

PATCH Rishabh Bhatnagar 1 participant 1 message Apr 6, 2018 USB

lore
Share & tools
lore
#0 lore raw

In file drivers/usb/core/phy.c line 114, ret variable is assigned to itself. The following error was observed:

kernel/drivers/usb/core/phy.c:114:8: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] error, forbidden
warning: phy.c:114
This error was found when compiling with Clang. Change it to ret = err.

Fixes commit 07dbff0ddbd8 ("usb: core: add a wrapper for the USB PHYs on the HCD")
---
 drivers/usb/core/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/phy.c +1 -1
index 09b7c43..f19aaa3 100644
@@ -111,7 +111,7 @@ int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub)
 	list_for_each_entry(roothub_entry, head, list) {
 		err = phy_exit(roothub_entry->phy);
 		if (err)
-			ret = ret;
+			ret = err;
 	}
 
 	return ret;