public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Zeeshan Ahmad <zeeshanahmad022019@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()
Date: Tue, 24 Feb 2026 00:41:32 +0000	[thread overview]
Message-ID: <20260224004126.ue3nfgzlf66rayfz@synopsys.com> (raw)
In-Reply-To: <aZgYKin2nP19CZyL@stanley.mountain>

On Fri, Feb 20, 2026, Dan Carpenter wrote:
> On Thu, Feb 19, 2026 at 10:55:29PM +0000, Thinh Nguyen wrote:
> > On Wed, Feb 18, 2026, Zeeshan Ahmad wrote:
> > > diff --git a/drivers/usb/dwc3/dwc3-qcom-legacy.c b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > index d3fad0fcfdac..34c578309802 100644
> > > --- a/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > +++ b/drivers/usb/dwc3/dwc3-qcom-legacy.c
> > > @@ -620,14 +620,14 @@ static int dwc3_qcom_find_num_ports(struct platform_device *pdev)
> > >  	int irq;
> > >  
> > >  	irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
> > > -	if (irq <= 0)
> > > +	if (irq < 0)
> > >  		return 1;
> > >  
> > >  	for (port_num = 2; port_num <= DWC3_QCOM_MAX_PORTS; port_num++) {
> > >  		sprintf(irq_name, "dp_hs_phy_%d", port_num);
> > >  
> > >  		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > > -		if (irq <= 0)
> > > +		if (irq < 0)
> > >  			return port_num - 1;
> > >  	}
> > >  
> > > -- 
> > > 2.43.0
> > > 
> > 
> > Since this is not a fix, I prefer new development to be on the dwc3-qcom
> > and not the dwc3-qcom-legacy glue.
> 
> There might be some static checker warnings for these?  Smatch only
> warns if people do an explicit zero check since
> platform_get_irq_byname_optional() can never return zero.
> 

But that aside, since this is new development rather than a fix, I'd
prefer to see it go into dwc3-qcom instead of the legacy driver. We
should be pushing new features to the main driver to keep things
consolidated and encourage people to migrate away from the legacy code.

BR,
Thinh

  parent reply	other threads:[~2026-02-24  0:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 11:01 [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports() Zeeshan Ahmad
2026-02-19 22:55 ` Thinh Nguyen
2026-02-20  8:15   ` Dan Carpenter
2026-02-21 10:41     ` Zeeshan Ahmad
2026-02-24  0:41     ` Thinh Nguyen [this message]
2026-02-24  6:44       ` Zeeshan Ahmad
2026-02-25  0:10         ` Thinh Nguyen
2026-02-25  6:42           ` [PATCH v2] " Zeeshan Ahmad
2026-02-25  6:51             ` [PATCH v3] " Zeeshan Ahmad
2026-02-26  2:14               ` Thinh Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2026-02-24  7:32 [PATCH] " Zeeshan Ahmad
2026-02-25  0:06 ` Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260224004126.ue3nfgzlf66rayfz@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=zeeshanahmad022019@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox