All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v2] usb: dwc3: remove dead code in dwc3_otg_get_irq
@ 2023-04-25  1:55 Liang Yuhang
  2023-04-25  5:12 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Liang Yuhang @ 2023-04-25  1:55 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman
  Cc: hust-os-kernel-patches, Liang Yuhang, 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: Liang Yuhang <lihuya@hust.edu.cn>

---
v1 -> v2: change name to real 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


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

* Re: [PATCH RESEND v2] usb: dwc3: remove dead code in dwc3_otg_get_irq
  2023-04-25  1:55 [PATCH RESEND v2] usb: dwc3: remove dead code in dwc3_otg_get_irq Liang Yuhang
@ 2023-04-25  5:12 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-04-25  5:12 UTC (permalink / raw)
  To: Liang Yuhang
  Cc: Thinh Nguyen, hust-os-kernel-patches, linux-usb, linux-kernel

On Tue, Apr 25, 2023 at 09:55:32AM +0800, Liang Yuhang 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: Liang Yuhang <lihuya@hust.edu.cn>
> 
> ---
> v1 -> v2: change name to real name
> ---
>  drivers/usb/dwc3/drd.c | 5 -----
>  1 file changed, 5 deletions(-)

Why is this a RESEND?  And why is it resent?  You changed something from
v1 to v2, but that does not mean it is a resend.

Note, I STRONGLY encourage people to get experience by working in
drivers/staging/ first, before going out to the rest of the kernel and
dealing with fast-moving subsystems.  Perhaps try that first?

thanks,

greg k-h

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25  1:55 [PATCH RESEND v2] usb: dwc3: remove dead code in dwc3_otg_get_irq Liang Yuhang
2023-04-25  5:12 ` Greg Kroah-Hartman

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.