linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dongliang Mu <mudongliangabcd@gmail.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: Pawel Laszczak <pawell@cadence.com>,
	Dongliang Mu <dzm91@hust.edu.cn>,
	Peter Chen <peter.chen@kernel.org>,
	Aswath Govindraju <a-govindraju@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: cdns3: remove dead code
Date: Wed, 28 Sep 2022 14:57:56 +0800	[thread overview]
Message-ID: <CAD-N9QV0Y9eduWD2N3Fmkmt_CW-EwmQVvpQOWx9BozS8hX3t_w@mail.gmail.com> (raw)
In-Reply-To: <cd5455e9-b9ea-9376-1440-3dbf790d4c24@kernel.org>

On Wed, Sep 28, 2022 at 2:49 PM Roger Quadros <rogerq@kernel.org> wrote:
>
> Hello Pawel,
>
> On 28/09/2022 09:40, Pawel Laszczak wrote:
> >>
> >> From: Dongliang Mu <mudongliangabcd@gmail.com>
> >>
> >> 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@gmail.com>
> >> ---
> >> 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;
> >>
> > I think that here we should have:
> >       else if (cdns->wakeup_irq == -ENXIO)
> >               return -EINVAL;
> >  because of function:
> > platform_get_irq_byname_optional -> __platform_get_irq_byname returns
> > irq number (>0),  -EPROBE_DEFFER or -ENXIO
>
> But this is changing functionality and should come as a new patch.

I agree. Pawel, you should submit a new patch. This satisfies the rule
of kernel patching.

>
> The original patch is correct as it doesn't change existing code
> functionality.
>
> >
> >
> > thanks
> > Pawel
> >
> >>      if (cdns->wakeup_irq < 0) {
> >>              dev_dbg(dev, "couldn't get wakeup irq\n");
> >> --
> >> 2.35.1
> >
>
> cheers,
> -roger

  reply	other threads:[~2022-09-28  7:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 13:59 [PATCH] usb: cdns3: remove dead code Dongliang Mu
2022-09-28  6:40 ` Pawel Laszczak
2022-09-28  6:49   ` Roger Quadros
2022-09-28  6:57     ` Dongliang Mu [this message]
2022-09-28  6:49 ` Roger Quadros
2022-09-28  7:04   ` Dongliang Mu

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=CAD-N9QV0Y9eduWD2N3Fmkmt_CW-EwmQVvpQOWx9BozS8hX3t_w@mail.gmail.com \
    --to=mudongliangabcd@gmail.com \
    --cc=a-govindraju@ti.com \
    --cc=dzm91@hust.edu.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=peter.chen@kernel.org \
    --cc=rogerq@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).