[PATCH linux-next] usb: dwc3: gadget: remove the unneeded result variable

cgel.zte@gmail.com posted 1 patch 3 years, 6 months ago
drivers/usb/dwc3/gadget.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH linux-next] usb: dwc3: gadget: remove the unneeded result variable
Posted by cgel.zte@gmail.com 3 years, 6 months ago
From: Xu Panda <xu.panda@zte.com.cn>

Return the value power_supply_set_property() directly instead of storing
it in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3a344ba0b292..762a92470a01 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2868,7 +2868,6 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA)
 {
        struct dwc3             *dwc = gadget_to_dwc(g);
        union power_supply_propval      val = {0};
-       int                             ret;

        if (dwc->usb2_phy)
                return usb_phy_set_power(dwc->usb2_phy, mA);
@@ -2877,9 +2876,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA)
                return -EOPNOTSUPP;

        val.intval = 1000 * mA;
-       ret = power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val);
-
-       return ret;
+       return power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val);
 }

 /**
-- 
2.15.2
Re: [PATCH linux-next] usb: dwc3: gadget: remove the unneeded result variable
Posted by Greg KH 3 years, 6 months ago
On Mon, Sep 12, 2022 at 10:28:55AM +0000, cgel.zte@gmail.com wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
> 
> Return the value power_supply_set_property() directly instead of storing
> it in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
> ---
>  drivers/usb/dwc3/gadget.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Sorry, I can not take this as you are not following the researcher
rules.

Also how do I know that this gmail account is really from ZTE?  Please
work with your company to fix this.

thanks,

greg k-h