linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: fengguang.wu@intel.com (kbuild test robot)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH] media: meson: fix zalloc-simple.cocci warnings
Date: Tue, 6 Nov 2018 20:07:24 +0800	[thread overview]
Message-ID: <20181106120724.GA79146@athens> (raw)
In-Reply-To: <20181106075926.19269-3-mjourdan@baylibre.com>

From: kbuild test robot <fengguang.wu@intel.com>

drivers/media/platform/meson/vdec/esparser.c:148:13-31: WARNING: dma_zalloc_coherent should be used for eos_vaddr, instead of dma_alloc_coherent/memset


 Use zeroing allocator rather than allocator followed by memset with 0

 This considers some simple cases that are common and easy to validate
 Note in particular that there are no ...s in the rule, so all of the
 matched code has to be contiguous

Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci

Fixes: 3ab8ea56b2f6 ("media: meson: add v4l2 m2m video decoder driver")
CC: Maxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Maxime-Jourdan/dt-bindings-media-add-Amlogic-Video-Decoder-Bindings/20181106-162646
base:   git://linuxtv.org/media_tree.git master

Please take the patch only if it's a positive warning. Thanks!

 esparser.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/media/platform/meson/vdec/esparser.c
+++ b/drivers/media/platform/meson/vdec/esparser.c
@@ -145,13 +145,11 @@ int esparser_queue_eos(struct amvdec_cor
 	dma_addr_t eos_paddr;
 	int ret;
 
-	eos_vaddr = dma_alloc_coherent(dev,
-				       len + SEARCH_PATTERN_LEN,
-				       &eos_paddr, GFP_KERNEL);
+	eos_vaddr = dma_zalloc_coherent(dev, len + SEARCH_PATTERN_LEN,
+					&eos_paddr, GFP_KERNEL);
 	if (!eos_vaddr)
 		return -ENOMEM;
 
-	memset(eos_vaddr, 0, len + SEARCH_PATTERN_LEN);
 	memcpy(eos_vaddr, data, len);
 	ret = esparser_write_data(core, eos_paddr, len);
 	dma_free_coherent(dev, len + SEARCH_PATTERN_LEN,

  parent reply	other threads:[~2018-11-06 12:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06  7:59 [PATCH v4 0/3] Add Amlogic video decoder driver Maxime Jourdan
2018-11-06  7:59 ` [PATCH v4 1/3] dt-bindings: media: add Amlogic Video Decoder Bindings Maxime Jourdan
2018-11-06  7:59 ` [PATCH v4 2/3] media: meson: add v4l2 m2m video decoder driver Maxime Jourdan
2018-11-06 11:26   ` kbuild test robot
2018-11-06 12:07   ` kbuild test robot
2018-11-06 12:07   ` [PATCH] media: meson: fix semicolon.cocci warnings kbuild test robot
2018-11-06 12:07   ` kbuild test robot
2018-11-06 12:07   ` kbuild test robot [this message]
2018-11-08  8:42   ` [PATCH v4 2/3] media: meson: add v4l2 m2m video decoder driver Hans Verkuil
2018-11-09 21:21     ` Nicolas Dufresne
2018-11-06  7:59 ` [PATCH v4 3/3] MAINTAINERS: Add meson video decoder Maxime Jourdan
2018-11-06 16:33 ` [PATCH v4 0/3] Add Amlogic video decoder driver Neil Armstrong

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=20181106120724.GA79146@athens \
    --to=fengguang.wu@intel.com \
    --cc=linus-amlogic@lists.infradead.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).