On Wed, Sep 28, 2022 at 2:50 PM Roger Quadros <rogerq@xxxxxxxxxx> wrote: > > > > On 26/09/2022 16:59, Dongliang Mu wrote: > > From: Dongliang Mu <mudongliangabcd@xxxxxxxxx> > > > > Smatch reports the following error: > > > > drivers/usb/cdns3/cdns3-plat.c:113 cdns3_plat_probe() warn: > > platform_get_irq() does not return zero > > > > From the document, platform_get_irq_byname_optional only returns > > non-zero value, and negative value on failure. > > > > Fix this by removing the zero value checking. > > > > Signed-off-by: Dongliang Mu <mudongliangabcd@xxxxxxxxx> > > Reviewed-by: Roger Quadros <rogerq@xxxxxxxxxx> Hi Roger, By simply checking the usage of API - platform_get_irq_byname_optional, there are several issues in other code sites. However, some code sites are related to semantics. I will analyze all of them and submit patches later. > > > --- > > drivers/usb/cdns3/cdns3-plat.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c > > index dc068e940ed5..2bc5d094548b 100644 > > --- a/drivers/usb/cdns3/cdns3-plat.c > > +++ b/drivers/usb/cdns3/cdns3-plat.c > > @@ -110,8 +110,6 @@ static int cdns3_plat_probe(struct platform_device *pdev) > > cdns->wakeup_irq = platform_get_irq_byname_optional(pdev, "wakeup"); > > if (cdns->wakeup_irq == -EPROBE_DEFER) > > return cdns->wakeup_irq; > > - else if (cdns->wakeup_irq == 0) > > - return -EINVAL; > > > > if (cdns->wakeup_irq < 0) { > > dev_dbg(dev, "couldn't get wakeup irq\n"); > > > cheers, > -roger