diff mbox series

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

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

Commit Message

Zhi, Yong Jan. 16, 2019, 5:18 p.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

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
[Bug report: https://lore.kernel.org/linux-media/20190104122856.GA1169@kadam/]
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/ipu3/ipu3.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Sakari Ailus Feb. 1, 2019, 10:43 a.m. UTC | #1
Hi Yong,

On Wed, Jan 16, 2019 at 09:18:47AM -0800, Yong Zhi 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
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> [Bug report: https://lore.kernel.org/linux-media/20190104122856.GA1169@kadam/]
> Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I don't see Laurent's Reviewed-by: tag on the list. Did you get that from
him off-list? If he hasn't given one, please send v3 without that tag.

Thanks.
Zhi, Yong Feb. 1, 2019, 3:47 p.m. UTC | #2
Hi, Sakari,

> -----Original Message-----
> From: Sakari Ailus [mailto:sakari.ailus@linux.intel.com]
> Sent: Friday, February 1, 2019 2:43 AM
> To: Zhi, Yong <yong.zhi@intel.com>
> Cc: linux-media@vger.kernel.org; Mani, Rajmohan
> <rajmohan.mani@intel.com>; tfiga@chromium.org;
> laurent.pinchart@ideasonboard.com; hans.verkuil@cisco.com;
> mchehab@kernel.org; dan.carpenter@oracle.com; Qiu, Tian Shu
> <tian.shu.qiu@intel.com>; Cao, Bingbu <bingbu.cao@intel.com>
> Subject: Re: [PATCH v2 2/2] media: ipu3-imgu: Remove dead code for NULL
> check
> 
> Hi Yong,
> 
> On Wed, Jan 16, 2019 at 09:18:47AM -0800, Yong Zhi 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
> >
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> [Bug report:
> > https://lore.kernel.org/linux-media/20190104122856.GA1169@kadam/]
> > Signed-off-by: Yong Zhi <yong.zhi@intel.com>
> > Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I don't see Laurent's Reviewed-by: tag on the list. Did you get that from him
> off-list? If he hasn't given one, please send v3 without that tag.
> 

The bug report link was suggested by Laurent, so that I assume he reviewed the patch, I can re-send without the tag if this does not count. 

> Thanks.
> 
> --
> Sakari Ailus
> sakari.ailus@linux.intel.com
diff mbox series

Patch

diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
index d521b3a..839d939 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;
 		}