* [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement
@ 2022-05-18 2:43 Li Zhengyu
2022-05-18 14:17 ` Alan Stern
2022-05-18 15:30 ` Dmitry Baryshkov
0 siblings, 2 replies; 4+ messages in thread
From: Li Zhengyu @ 2022-05-18 2:43 UTC (permalink / raw)
To: dbaryshkov; +Cc: stern, gregkh, linux-usb, linux-kernel
(ret == 0) is true when (ret) is false, so remove it.
Also remove unreachable code.
Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
---
drivers/usb/host/ohci-tmio.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
index 49539b9f0e94..6bcb0cb53f7c 100644
--- a/drivers/usb/host/ohci-tmio.c
+++ b/drivers/usb/host/ohci-tmio.c
@@ -243,12 +243,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
ret = usb_add_hcd(hcd, irq, 0);
if (ret)
goto err_add_hcd;
-
device_wakeup_enable(hcd->self.controller);
- if (ret == 0)
- return ret;
-
- usb_remove_hcd(hcd);
+ return ret;
err_add_hcd:
tmio_stop_hc(dev);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement
2022-05-18 2:43 [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement Li Zhengyu
@ 2022-05-18 14:17 ` Alan Stern
2022-05-18 15:30 ` Dmitry Baryshkov
1 sibling, 0 replies; 4+ messages in thread
From: Alan Stern @ 2022-05-18 14:17 UTC (permalink / raw)
To: Li Zhengyu; +Cc: dbaryshkov, gregkh, linux-usb, linux-kernel
On Wed, May 18, 2022 at 10:43:47AM +0800, Li Zhengyu wrote:
> (ret == 0) is true when (ret) is false, so remove it.
> Also remove unreachable code.
>
> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/host/ohci-tmio.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
> index 49539b9f0e94..6bcb0cb53f7c 100644
> --- a/drivers/usb/host/ohci-tmio.c
> +++ b/drivers/usb/host/ohci-tmio.c
> @@ -243,12 +243,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
> ret = usb_add_hcd(hcd, irq, 0);
> if (ret)
> goto err_add_hcd;
> -
> device_wakeup_enable(hcd->self.controller);
> - if (ret == 0)
> - return ret;
> -
> - usb_remove_hcd(hcd);
> + return ret;
>
> err_add_hcd:
> tmio_stop_hc(dev);
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement
2022-05-18 2:43 [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement Li Zhengyu
2022-05-18 14:17 ` Alan Stern
@ 2022-05-18 15:30 ` Dmitry Baryshkov
2022-05-19 1:39 ` lizhengyu (E)
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-05-18 15:30 UTC (permalink / raw)
To: Li Zhengyu; +Cc: Alan Stern, Greg Kroah-Hartman, linux-usb, kernel list
ср, 18 мая 2022 г. в 05:45, Li Zhengyu <lizhengyu3@huawei.com>:
>
> (ret == 0) is true when (ret) is false, so remove it.
> Also remove unreachable code.
>
> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
> ---
> drivers/usb/host/ohci-tmio.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
> index 49539b9f0e94..6bcb0cb53f7c 100644
> --- a/drivers/usb/host/ohci-tmio.c
> +++ b/drivers/usb/host/ohci-tmio.c
> @@ -243,12 +243,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
> ret = usb_add_hcd(hcd, irq, 0);
> if (ret)
> goto err_add_hcd;
> -
> device_wakeup_enable(hcd->self.controller);
I think the proper patch would be to check the return value of
device_wakeup_enable(), so NAK.
> - if (ret == 0)
> - return ret;
> -
> - usb_remove_hcd(hcd);
> + return ret;
>
> err_add_hcd:
> tmio_stop_hc(dev);
> --
> 2.17.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement
2022-05-18 15:30 ` Dmitry Baryshkov
@ 2022-05-19 1:39 ` lizhengyu (E)
0 siblings, 0 replies; 4+ messages in thread
From: lizhengyu (E) @ 2022-05-19 1:39 UTC (permalink / raw)
To: Dmitry Baryshkov; +Cc: Alan Stern, Greg Kroah-Hartman, linux-usb, kernel list
On Wed, 18 May 2022 18:30:15 +0300, Dmitry Baryshkov
<dbaryshkov@gmail.com> wrote:
> ср, 18 мая 2022 г. в 05:45, Li Zhengyu <lizhengyu3@huawei.com>:
>> (ret == 0) is true when (ret) is false, so remove it.
>> Also remove unreachable code.
>>
>> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
>> ---
>> drivers/usb/host/ohci-tmio.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
>> index 49539b9f0e94..6bcb0cb53f7c 100644
>> --- a/drivers/usb/host/ohci-tmio.c
>> +++ b/drivers/usb/host/ohci-tmio.c
>> @@ -243,12 +243,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
>> ret = usb_add_hcd(hcd, irq, 0);
>> if (ret)
>> goto err_add_hcd;
>> -
>> device_wakeup_enable(hcd->self.controller);
> I think the proper patch would be to check the return value of
> device_wakeup_enable(), so NAK.
>
>> - if (ret == 0)
>> - return ret;
>> -
>> - usb_remove_hcd(hcd);
>> + return ret;
>>
>> err_add_hcd:
>> tmio_stop_hc(dev);
>> --
>> 2.17.1
>>
>
Thanks, I will fix it soon.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-19 1:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-18 2:43 [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement Li Zhengyu
2022-05-18 14:17 ` Alan Stern
2022-05-18 15:30 ` Dmitry Baryshkov
2022-05-19 1:39 ` lizhengyu (E)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox