* Usb: core: Correct self assignment in phy.c
@ 2018-04-07 10:55 Martin Blumenstingl
0 siblings, 0 replies; 2+ messages in thread
From: Martin Blumenstingl @ 2018-04-07 10:55 UTC (permalink / raw)
To: Rishabh Bhatnagar; +Cc: gregkh, linux-usb, linux-arm-msm
Hello,
thank you for finding this!
On Sat, Apr 7, 2018 at 1:04 AM, Rishabh Bhatnagar
<rishabhb@codeaurora.org> wrote:
> 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.
I found the same bug myself two weeks ago and already sent a patch: [0]
it has not made it to Greg's tree yet. Greg asked me to re-send that
patch along with some others after -rc1 is out: [1]
> Fixes: commit 07dbff0ddbd8 ("usb: core: add a wrapper for the USB PHYs on the HCD")
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
would you like me to add your Acked-by or Signed-off-by to my patch?
> ---
> drivers/usb/core/phy.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c
> index 09b7c43..f19aaa3 100644
> --- a/drivers/usb/core/phy.c
> +++ b/drivers/usb/core/phy.c
> @@ -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;
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Regards
Martin
[0] http://lists.infradead.org/pipermail/linux-amlogic/2018-March/006819.html
[1] http://lists.infradead.org/pipermail/linux-amlogic/2018-April/006977.html
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Usb: core: Correct self assignment in phy.c
@ 2018-04-06 23:04 Rishabh Bhatnagar
0 siblings, 0 replies; 2+ messages in thread
From: Rishabh Bhatnagar @ 2018-04-06 23:04 UTC (permalink / raw)
To: martin.blumenstingl, gregkh; +Cc: linux-usb, linux-arm-msm, Rishabh Bhatnagar
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")
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
---
drivers/usb/core/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c
index 09b7c43..f19aaa3 100644
--- a/drivers/usb/core/phy.c
+++ b/drivers/usb/core/phy.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-07 10:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-07 10:55 Usb: core: Correct self assignment in phy.c Martin Blumenstingl
-- strict thread matches above, loose matches on Subject: below --
2018-04-06 23:04 Rishabh Bhatnagar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.