Linux USB
 help / color / mirror / Atom feed
* [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq
@ 2023-04-24 10:59 lihuya
  2023-04-24 21:33 ` Thinh Nguyen
  2023-04-25  8:57 ` Sergey Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: lihuya @ 2023-04-24 10:59 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: hust-os-kernel-patches, lihuya, linux-usb, linux-kernel

platform_get_irq() only return non-zero irq number on success, or
negative error number on failure.

There is no need to check the return value of platform_get_irq()
to determine the return value of dwc3_otg_get_irq(), removing
them to solve this problem.

Signed-off-by: lihuya <lihuya@hust.edu.cn>
---
 drivers/usb/dwc3/drd.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
index 039bf241769a..c2e09700212d 100644
--- a/drivers/usb/dwc3/drd.c
+++ b/drivers/usb/dwc3/drd.c
@@ -154,11 +154,6 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc)
 		goto out;
 
 	irq = platform_get_irq(dwc3_pdev, 0);
-	if (irq > 0)
-		goto out;
-
-	if (!irq)
-		irq = -EINVAL;
 
 out:
 	return irq;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq
  2023-04-24 10:59 [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq lihuya
@ 2023-04-24 21:33 ` Thinh Nguyen
  2023-04-24 23:29   ` Dongliang Mu
  2023-04-25  8:57 ` Sergey Shtylyov
  1 sibling, 1 reply; 5+ messages in thread
From: Thinh Nguyen @ 2023-04-24 21:33 UTC (permalink / raw)
  To: lihuya
  Cc: Thinh Nguyen, Greg Kroah-Hartman,
	hust-os-kernel-patches@googlegroups.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org

On Mon, Apr 24, 2023, lihuya wrote:
> platform_get_irq() only return non-zero irq number on success, or
> negative error number on failure.
> 
> There is no need to check the return value of platform_get_irq()
> to determine the return value of dwc3_otg_get_irq(), removing
> them to solve this problem.
> 
> Signed-off-by: lihuya <lihuya@hust.edu.cn>

Is this your full name?

> ---
>  drivers/usb/dwc3/drd.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
> index 039bf241769a..c2e09700212d 100644
> --- a/drivers/usb/dwc3/drd.c
> +++ b/drivers/usb/dwc3/drd.c
> @@ -154,11 +154,6 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc)
>  		goto out;
>  
>  	irq = platform_get_irq(dwc3_pdev, 0);
> -	if (irq > 0)
> -		goto out;
> -
> -	if (!irq)
> -		irq = -EINVAL;
>  
>  out:
>  	return irq;
> -- 
> 2.34.1
> 

FWIW, here's the ack again.

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq
  2023-04-24 21:33 ` Thinh Nguyen
@ 2023-04-24 23:29   ` Dongliang Mu
  0 siblings, 0 replies; 5+ messages in thread
From: Dongliang Mu @ 2023-04-24 23:29 UTC (permalink / raw)
  To: Thinh Nguyen, lihuya
  Cc: Greg Kroah-Hartman, hust-os-kernel-patches@googlegroups.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org


On 2023/4/25 05:33, 'Thinh Nguyen' via HUST OS Kernel Contribution wrote:
> On Mon, Apr 24, 2023, lihuya wrote:
>> platform_get_irq() only return non-zero irq number on success, or
>> negative error number on failure.
>>
>> There is no need to check the return value of platform_get_irq()
>> to determine the return value of dwc3_otg_get_irq(), removing
>> them to solve this problem.
>>
>> Signed-off-by: lihuya <lihuya@hust.edu.cn>
> Is this your full name?

Hi Yuhang,

Please use your full name: Yuhang Liang. This is essential in the kernel 
patch submission.

Dongliang Mu

>
>> ---
>>   drivers/usb/dwc3/drd.c | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
>> index 039bf241769a..c2e09700212d 100644
>> --- a/drivers/usb/dwc3/drd.c
>> +++ b/drivers/usb/dwc3/drd.c
>> @@ -154,11 +154,6 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc)
>>   		goto out;
>>   
>>   	irq = platform_get_irq(dwc3_pdev, 0);
>> -	if (irq > 0)
>> -		goto out;
>> -
>> -	if (!irq)
>> -		irq = -EINVAL;
>>   
>>   out:
>>   	return irq;
>> -- 
>> 2.34.1
>>
> FWIW, here's the ack again.
>
> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>
> Thanks,
> Thinh
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq
  2023-04-24 10:59 [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq lihuya
  2023-04-24 21:33 ` Thinh Nguyen
@ 2023-04-25  8:57 ` Sergey Shtylyov
  2023-04-25  9:10   ` Dongliang Mu
  1 sibling, 1 reply; 5+ messages in thread
From: Sergey Shtylyov @ 2023-04-25  8:57 UTC (permalink / raw)
  To: lihuya, Thinh Nguyen, Greg Kroah-Hartman
  Cc: hust-os-kernel-patches, linux-usb, linux-kernel

Hello!

On 4/24/23 1:59 PM, lihuya wrote:

> platform_get_irq() only return non-zero irq number on success, or
> negative error number on failure.
> 
> There is no need to check the return value of platform_get_irq()
> to determine the return value of dwc3_otg_get_irq(), removing
> them to solve this problem.

   I was going to submit such patch myself at some point... which
has never happened. :-/

> Signed-off-by: lihuya <lihuya@hust.edu.cn>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq
  2023-04-25  8:57 ` Sergey Shtylyov
@ 2023-04-25  9:10   ` Dongliang Mu
  0 siblings, 0 replies; 5+ messages in thread
From: Dongliang Mu @ 2023-04-25  9:10 UTC (permalink / raw)
  To: Sergey Shtylyov, lihuya, Thinh Nguyen, Greg Kroah-Hartman
  Cc: hust-os-kernel-patches, linux-usb, linux-kernel


On 2023/4/25 16:57, Sergey Shtylyov wrote:
> Hello!
>
> On 4/24/23 1:59 PM, lihuya wrote:
>
>> platform_get_irq() only return non-zero irq number on success, or
>> negative error number on failure.
>>
>> There is no need to check the return value of platform_get_irq()
>> to determine the return value of dwc3_otg_get_irq(), removing
>> them to solve this problem.
>     I was going to submit such patch myself at some point... which
> has never happened. :-/
>
>> Signed-off-by: lihuya <lihuya@hust.edu.cn>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Hi Sergey,

Please take a look at the following thread [1]. Yuhang sent a v2 patch 
since he did not use his real name in the Signed-off-by.

Greg already had some comments on this patch.

[1] https://lore.kernel.org/lkml/20230425015532.13622-1-lihuya@hust.edu.cn/

>
> [...]
>
> MBR, Sergey
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-25  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-24 10:59 [PATCH RESEND] usb: dwc3: remove dead code in dwc3_otg_get_irq lihuya
2023-04-24 21:33 ` Thinh Nguyen
2023-04-24 23:29   ` Dongliang Mu
2023-04-25  8:57 ` Sergey Shtylyov
2023-04-25  9:10   ` Dongliang Mu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox