All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhi <yong.zhi@intel.com>
To: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com
Cc: jian.xu.zheng@intel.com, tfiga@chromium.org,
	rajmohan.mani@intel.com, tuukka.toivonen@intel.com,
	hyungwoo.yang@intel.com, chiranjeevi.rapolu@intel.com,
	jerry.w.hu@intel.com, Yong Zhi <yong.zhi@intel.com>
Subject: Re: [PATCH v8 3/4] intel-ipu3: cio2: add new MIPI-CSI2 driver
Date: Thu,  9 Nov 2017 14:25:26 -0800	[thread overview]
Message-ID: <1510266326-15516-1-git-send-email-yong.zhi@intel.com> (raw)

Hi, Sakari,

Fixed warnings about memset of pointer array and unsigned int used for 0 comparison
reported by static code analysis tool, please squash this to the driver, thanks!!

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 39d89ee..4295bdb 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -842,7 +842,7 @@ static int cio2_vb2_buf_init(struct vb2_buffer *vb)
 	unsigned int lops = DIV_ROUND_UP(pages + 1, entries_per_page);
 	struct sg_table *sg;
 	struct sg_page_iter sg_iter;
-	unsigned int i, j;
+	int i, j;
 
 	if (lops <= 0 || lops > CIO2_MAX_LOPS) {
 		dev_err(dev, "%s: bad buffer size (%i)\n", __func__,
@@ -850,7 +850,7 @@ static int cio2_vb2_buf_init(struct vb2_buffer *vb)
 		return -ENOSPC;		/* Should never happen */
 	}
 
-	memset(b->lop, 0, sizeof(*b->lop));
+	memset(b->lop, 0, sizeof(b->lop));
 	/* Allocate LOP table */
 	for (i = 0; i < lops; i++) {
 		b->lop[i] = dma_alloc_coherent(dev, CIO2_PAGE_SIZE,
@@ -880,7 +880,7 @@ static int cio2_vb2_buf_init(struct vb2_buffer *vb)
 	b->lop[i][j] = cio2->dummy_page_bus_addr >> PAGE_SHIFT;
 	return 0;
 fail:
-	for (; i >= 0; i--)
+	for (i--; i >= 0; i--)
 		dma_free_coherent(dev, CIO2_PAGE_SIZE,
 				  b->lop[i], b->lop_bus_addr[i]);
 	return -ENOMEM;
-- 
1.9.1

             reply	other threads:[~2017-11-09 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 22:25 Yong Zhi [this message]
2017-11-10 18:14 ` [PATCH v8 3/4] intel-ipu3: cio2: add new MIPI-CSI2 driver Sakari Ailus
  -- strict thread matches above, loose matches on Subject: below --
2017-11-09  0:30 [PATCH v8 0/4] add IPU3 CIO2 CSI2 driver Yong Zhi
2017-11-09  0:30 ` [PATCH v8 3/4] intel-ipu3: cio2: add new MIPI-CSI2 driver Yong Zhi

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=1510266326-15516-1-git-send-email-yong.zhi@intel.com \
    --to=yong.zhi@intel.com \
    --cc=chiranjeevi.rapolu@intel.com \
    --cc=hyungwoo.yang@intel.com \
    --cc=jerry.w.hu@intel.com \
    --cc=jian.xu.zheng@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=rajmohan.mani@intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    --cc=tuukka.toivonen@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.