2023-03-23 05:45:46

by Liang Yuhang

[permalink] [raw]
Subject: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq

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 <[email protected]>
---
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


2023-03-24 18:32:43

by Thinh Nguyen

[permalink] [raw]
Subject: Re: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq

On Thu, Mar 23, 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 <[email protected]>
> ---
> 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
>

Acked-by: Thinh Nguyen <[email protected]>

Thanks,
Thinh

2023-04-24 09:00:02

by Liang Yuhang

[permalink] [raw]
Subject: Re: Re: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq

> -----Original Messages-----
> From: "Thinh Nguyen" <[email protected]>
> Sent Time: 2023-03-25 02:28:56 (Saturday)
> To: lihuya <[email protected]>
> Cc: "Thinh Nguyen" <[email protected]>, "Greg Kroah-Hartman" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
> Subject: Re: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq
>
> On Thu, Mar 23, 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 <[email protected]>
> > ---
> > 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
> >
>
> Acked-by: Thinh Nguyen <[email protected]>
>
> Thanks,
> Thinh

Hi Thinh,

I'm checking in about my patch submission for usb dwc3 that was
"ack'ed" on 3/25, but hasn't been merged into the subtree yet.
Could you please provide me with an update on its status and let
me know if there are any issues or concerns that need to be addressed?

2023-04-24 10:47:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: Re: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq

On Mon, Apr 24, 2023 at 04:45:14PM +0800, 梁宇航 wrote:
> > -----Original Messages-----
> > From: "Thinh Nguyen" <[email protected]>
> > Sent Time: 2023-03-25 02:28:56 (Saturday)
> > To: lihuya <[email protected]>
> > Cc: "Thinh Nguyen" <[email protected]>, "Greg Kroah-Hartman" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
> > Subject: Re: [PATCH] usb: dwc3: remove dead code in dwc3_otg_get_irq
> >
> > On Thu, Mar 23, 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 <[email protected]>
> > > ---
> > > 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
> > >
> >
> > Acked-by: Thinh Nguyen <[email protected]>
> >
> > Thanks,
> > Thinh
>
> Hi Thinh,
>
> I'm checking in about my patch submission for usb dwc3 that was
> "ack'ed" on 3/25, but hasn't been merged into the subtree yet.
> Could you please provide me with an update on its status and let
> me know if there are any issues or concerns that need to be addressed?

It's not in my queue anywhere, so it needs to be resent if anyone wants
this applied.

thanks,

greg k-h