From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26C30C32789 for ; Tue, 6 Nov 2018 12:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA3EF2086A for ; Tue, 6 Nov 2018 12:08:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA3EF2086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388362AbeKFVdT (ORCPT ); Tue, 6 Nov 2018 16:33:19 -0500 Received: from mga12.intel.com ([192.55.52.136]:31198 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387498AbeKFVdS (ORCPT ); Tue, 6 Nov 2018 16:33:18 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 04:08:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,471,1534834800"; d="scan'208";a="83701571" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by fmsmga007.fm.intel.com with ESMTP; 06 Nov 2018 04:08:22 -0800 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1gK09e-00078E-5L; Tue, 06 Nov 2018 20:08:22 +0800 Date: Tue, 6 Nov 2018 20:07:24 +0800 From: kbuild test robot To: Maxime Jourdan Cc: kbuild-all@01.org, Mauro Carvalho Chehab , Hans Verkuil , Kevin Hilman , Jerome Brunet , Neil Armstrong , Martin Blumenstingl , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [PATCH] media: meson: fix zalloc-simple.cocci warnings Message-ID: <20181106120724.GA79146@athens> References: <20181106075926.19269-3-mjourdan@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181106075926.19269-3-mjourdan@baylibre.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kbuild test robot 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 Signed-off-by: kbuild test robot --- 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,