diff mbox series

[2/2] media: ipu3-imgu: Remove dead code for NULL check

Message ID 1547523465-27807-2-git-send-email-yong.zhi@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] media: ipu3-imgu: Use MENU type for mode control | expand

Commit Message

Zhi, Yong Jan. 15, 2019, 3:37 a.m. UTC
Since ipu3_css_buf_dequeue() never returns NULL, remove the
dead code to fix static checker warning:

drivers/staging/media/ipu3/ipu3.c:493 imgu_isr_threaded()
warn: 'b' is an error pointer or valid

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
---
Link to Dan's bug report:
https://www.spinics.net/lists/linux-media/msg145043.html

 drivers/staging/media/ipu3/ipu3.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Tomasz Figa Jan. 15, 2019, 5:38 a.m. UTC | #1
Hi Yong,

On Tue, Jan 15, 2019 at 12:38 PM Yong Zhi <yong.zhi@intel.com> wrote:
>
> Since ipu3_css_buf_dequeue() never returns NULL, remove the
> dead code to fix static checker warning:
>
> drivers/staging/media/ipu3/ipu3.c:493 imgu_isr_threaded()
> warn: 'b' is an error pointer or valid
>
> Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> ---
> Link to Dan's bug report:
> https://www.spinics.net/lists/linux-media/msg145043.html

You can add Dan's Reported-by above your Signed-off-by to properly
credit him. I'd also add a comment below that Reported-by, e.g.

[Bug report: https://www.spinics.net/lists/linux-media/msg145043.html]

so that it doesn't get removed when applying the patch, as it would
get now, because any text right in this area is ignored by git.

With that fixes, feel free to add my Reviewed-by.

Best regards,
Tomasz

>
>  drivers/staging/media/ipu3/ipu3.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> index d521b3afb8b1..839d9398f8e9 100644
> --- a/drivers/staging/media/ipu3/ipu3.c
> +++ b/drivers/staging/media/ipu3/ipu3.c
> @@ -489,12 +489,11 @@ static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
>                         mutex_unlock(&imgu->lock);
>                 } while (PTR_ERR(b) == -EAGAIN);
>
> -               if (IS_ERR_OR_NULL(b)) {
> -                       if (!b || PTR_ERR(b) == -EBUSY) /* All done */
> -                               break;
> -                       dev_err(&imgu->pci_dev->dev,
> -                               "failed to dequeue buffers (%ld)\n",
> -                               PTR_ERR(b));
> +               if (IS_ERR(b)) {
> +                       if (PTR_ERR(b) != -EBUSY)       /* All done */
> +                               dev_err(&imgu->pci_dev->dev,
> +                                       "failed to dequeue buffers (%ld)\n",
> +                                       PTR_ERR(b));
>                         break;
>                 }
>
> --
> 2.7.4
>
Zhi, Yong Jan. 15, 2019, 4:03 p.m. UTC | #2
Hi, Tomasz,

> -----Original Message-----
> From: Tomasz Figa [mailto:tfiga@chromium.org]
> Sent: Monday, January 14, 2019 11:38 PM
> To: Zhi, Yong <yong.zhi@intel.com>
> Cc: Linux Media Mailing List <linux-media@vger.kernel.org>; Sakari Ailus
> <sakari.ailus@linux.intel.com>; Mani, Rajmohan
> <rajmohan.mani@intel.com>; Qiu, Tian Shu <tian.shu.qiu@intel.com>;
> Laurent Pinchart <laurent.pinchart@ideasonboard.com>; Hans Verkuil
> <hans.verkuil@cisco.com>; Mauro Carvalho Chehab <mchehab@kernel.org>;
> Cao, Bingbu <bingbu.cao@intel.com>; dan.carpenter@oracle.com
> Subject: Re: [PATCH 2/2] media: ipu3-imgu: Remove dead code for NULL
> check
> 
> Hi Yong,
> 
> On Tue, Jan 15, 2019 at 12:38 PM Yong Zhi <yong.zhi@intel.com> wrote:
> >
> > Since ipu3_css_buf_dequeue() never returns NULL, remove the dead code
> > to fix static checker warning:
> >
> > drivers/staging/media/ipu3/ipu3.c:493 imgu_isr_threaded()
> > warn: 'b' is an error pointer or valid
> >
> > Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> > ---
> > Link to Dan's bug report:
> > https://www.spinics.net/lists/linux-media/msg145043.html
> 
> You can add Dan's Reported-by above your Signed-off-by to properly credit
> him. I'd also add a comment below that Reported-by, e.g.
> 
> [Bug report: https://www.spinics.net/lists/linux-media/msg145043.html]
> 
> so that it doesn't get removed when applying the patch, as it would get now,
> because any text right in this area is ignored by git.
> 
> With that fixes, feel free to add my Reviewed-by.

Thanks a lot for the detailed instructions :)

> 
> Best regards,
> Tomasz
> 
> >
> >  drivers/staging/media/ipu3/ipu3.c | 11 +++++------
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/media/ipu3/ipu3.c
> > b/drivers/staging/media/ipu3/ipu3.c
> > index d521b3afb8b1..839d9398f8e9 100644
> > --- a/drivers/staging/media/ipu3/ipu3.c
> > +++ b/drivers/staging/media/ipu3/ipu3.c
> > @@ -489,12 +489,11 @@ static irqreturn_t imgu_isr_threaded(int irq, void
> *imgu_ptr)
> >                         mutex_unlock(&imgu->lock);
> >                 } while (PTR_ERR(b) == -EAGAIN);
> >
> > -               if (IS_ERR_OR_NULL(b)) {
> > -                       if (!b || PTR_ERR(b) == -EBUSY) /* All done */
> > -                               break;
> > -                       dev_err(&imgu->pci_dev->dev,
> > -                               "failed to dequeue buffers (%ld)\n",
> > -                               PTR_ERR(b));
> > +               if (IS_ERR(b)) {
> > +                       if (PTR_ERR(b) != -EBUSY)       /* All done */
> > +                               dev_err(&imgu->pci_dev->dev,
> > +                                       "failed to dequeue buffers (%ld)\n",
> > +                                       PTR_ERR(b));
> >                         break;
> >                 }
> >
> > --
> > 2.7.4
> >
Laurent Pinchart Jan. 15, 2019, 4:39 p.m. UTC | #3
Hi Tomasz,

On Tuesday, 15 January 2019 07:38:01 EET Tomasz Figa wrote:
> On Tue, Jan 15, 2019 at 12:38 PM Yong Zhi <yong.zhi@intel.com> wrote:
> > Since ipu3_css_buf_dequeue() never returns NULL, remove the
> > dead code to fix static checker warning:
> > 
> > drivers/staging/media/ipu3/ipu3.c:493 imgu_isr_threaded()
> > warn: 'b' is an error pointer or valid
> > 
> > Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> > ---
> > Link to Dan's bug report:
> > https://www.spinics.net/lists/linux-media/msg145043.html
> 
> You can add Dan's Reported-by above your Signed-off-by to properly
> credit him. I'd also add a comment below that Reported-by, e.g.
> 
> [Bug report: https://www.spinics.net/lists/linux-media/msg145043.html]

How about pointing to https://lore.kernel.org/linux-media/
20190104122856.GA1169@kadam/ instead, now that we have a shiny new archive 
that should be stable until the end of times ? :-)

> so that it doesn't get removed when applying the patch, as it would
> get now, because any text right in this area is ignored by git.
> 
> With that fixes, feel free to add my Reviewed-by.
> 
> Best regards,
> Tomasz
> 
> >  drivers/staging/media/ipu3/ipu3.c | 11 +++++------
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/staging/media/ipu3/ipu3.c
> > b/drivers/staging/media/ipu3/ipu3.c index d521b3afb8b1..839d9398f8e9
> > 100644
> > --- a/drivers/staging/media/ipu3/ipu3.c
> > +++ b/drivers/staging/media/ipu3/ipu3.c
> > @@ -489,12 +489,11 @@ static irqreturn_t imgu_isr_threaded(int irq, void
> > *imgu_ptr)> 
> >                         mutex_unlock(&imgu->lock);
> >                 
> >                 } while (PTR_ERR(b) == -EAGAIN);
> > 
> > -               if (IS_ERR_OR_NULL(b)) {
> > -                       if (!b || PTR_ERR(b) == -EBUSY) /* All done */
> > -                               break;
> > -                       dev_err(&imgu->pci_dev->dev,
> > -                               "failed to dequeue buffers (%ld)\n",
> > -                               PTR_ERR(b));
> > +               if (IS_ERR(b)) {
> > +                       if (PTR_ERR(b) != -EBUSY)       /* All done */
> > +                               dev_err(&imgu->pci_dev->dev,
> > +                                       "failed to dequeue buffers
> > (%ld)\n", +                                       PTR_ERR(b));
> > 
> >                         break;
> >                 
> >                 }
> > 
> > --
> > 2.7.4
Tomasz Figa Jan. 16, 2019, 2:15 a.m. UTC | #4
On Wed, Jan 16, 2019 at 1:38 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Tomasz,
>
> On Tuesday, 15 January 2019 07:38:01 EET Tomasz Figa wrote:
> > On Tue, Jan 15, 2019 at 12:38 PM Yong Zhi <yong.zhi@intel.com> wrote:
> > > Since ipu3_css_buf_dequeue() never returns NULL, remove the
> > > dead code to fix static checker warning:
> > >
> > > drivers/staging/media/ipu3/ipu3.c:493 imgu_isr_threaded()
> > > warn: 'b' is an error pointer or valid
> > >
> > > Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> > > ---
> > > Link to Dan's bug report:
> > > https://www.spinics.net/lists/linux-media/msg145043.html
> >
> > You can add Dan's Reported-by above your Signed-off-by to properly
> > credit him. I'd also add a comment below that Reported-by, e.g.
> >
> > [Bug report: https://www.spinics.net/lists/linux-media/msg145043.html]
>
> How about pointing to https://lore.kernel.org/linux-media/
> 20190104122856.GA1169@kadam/ instead, now that we have a shiny new archive
> that should be stable until the end of times ? :-)
>

Even better, thanks! (I often use the lore patchwork, but somehow I
wasn't able to look that patch up there. :))

> > so that it doesn't get removed when applying the patch, as it would
> > get now, because any text right in this area is ignored by git.
> >
> > With that fixes, feel free to add my Reviewed-by.
> >
> > Best regards,
> > Tomasz
> >
> > >  drivers/staging/media/ipu3/ipu3.c | 11 +++++------
> > >  1 file changed, 5 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/media/ipu3/ipu3.c
> > > b/drivers/staging/media/ipu3/ipu3.c index d521b3afb8b1..839d9398f8e9
> > > 100644
> > > --- a/drivers/staging/media/ipu3/ipu3.c
> > > +++ b/drivers/staging/media/ipu3/ipu3.c
> > > @@ -489,12 +489,11 @@ static irqreturn_t imgu_isr_threaded(int irq, void
> > > *imgu_ptr)>
> > >                         mutex_unlock(&imgu->lock);
> > >
> > >                 } while (PTR_ERR(b) == -EAGAIN);
> > >
> > > -               if (IS_ERR_OR_NULL(b)) {
> > > -                       if (!b || PTR_ERR(b) == -EBUSY) /* All done */
> > > -                               break;
> > > -                       dev_err(&imgu->pci_dev->dev,
> > > -                               "failed to dequeue buffers (%ld)\n",
> > > -                               PTR_ERR(b));
> > > +               if (IS_ERR(b)) {
> > > +                       if (PTR_ERR(b) != -EBUSY)       /* All done */
> > > +                               dev_err(&imgu->pci_dev->dev,
> > > +                                       "failed to dequeue buffers
> > > (%ld)\n", +                                       PTR_ERR(b));
> > >
> > >                         break;
> > >
> > >                 }
> > >
> > > --
> > > 2.7.4
>
>
> --
> Regards,
>
> Laurent Pinchart
>
>
>
diff mbox series

Patch

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index d521b3afb8b1..839d9398f8e9 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -489,12 +489,11 @@  static irqreturn_t imgu_isr_threaded(int irq, void *imgu_ptr)
 			mutex_unlock(&imgu->lock);
 		} while (PTR_ERR(b) == -EAGAIN);
 
-		if (IS_ERR_OR_NULL(b)) {
-			if (!b || PTR_ERR(b) == -EBUSY)	/* All done */
-				break;
-			dev_err(&imgu->pci_dev->dev,
-				"failed to dequeue buffers (%ld)\n",
-				PTR_ERR(b));
+		if (IS_ERR(b)) {
+			if (PTR_ERR(b) != -EBUSY)	/* All done */
+				dev_err(&imgu->pci_dev->dev,
+					"failed to dequeue buffers (%ld)\n",
+					PTR_ERR(b));
 			break;
 		}