From patchwork Mon Feb 25 18:39:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 10828995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2788F139A for ; Mon, 25 Feb 2019 18:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1673B2AE0D for ; Mon, 25 Feb 2019 18:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 088AC2AE0F; Mon, 25 Feb 2019 18:40:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF08E2AE0D for ; Mon, 25 Feb 2019 18:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFC1489B27; Mon, 25 Feb 2019 18:39:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 31AB489B27; Mon, 25 Feb 2019 18:39:56 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 10:39:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,412,1544515200"; d="scan'208";a="120682014" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by orsmga008.jf.intel.com with ESMTP; 25 Feb 2019 10:39:53 -0800 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1gyLAO-000CJq-PB; Tue, 26 Feb 2019 02:39:52 +0800 Date: Tue, 26 Feb 2019 02:39:28 +0800 From: kbuild test robot To: Qiang Yu Subject: [PATCH] drm/lima: fix memdup.cocci warnings Message-ID: <20190225183928.GA830@lkp-wsm-ep1> References: <20190225140717.20586-3-yuq825@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190225140717.20586-3-yuq825@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Simon Shields , lima@lists.freedesktop.org, Neil Armstrong , Maxime Ripard , Christian =?iso-8859-1?q?K=F6nig?= , dri-devel@lists.freedesktop.org, Vasily Khoruzhick , David Airlie , kbuild-all@01.org, Erico Nunes , Sean Paul , Andreas Baierl , Qiang Yu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/gpu/drm/lima/lima_sched.c:115:13-20: WARNING opportunity for kmemdup Use kmemdup rather than duplicating its implementation Generated by: scripts/coccinelle/api/memdup.cocci Fixes: ef1d65006858 ("drm/lima: driver for ARM Mali4xx GPUs") CC: Qiang Yu Signed-off-by: kbuild test robot --- url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350 Please take the patch only if it's a positive warning. Thanks! lima_sched.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -112,10 +112,9 @@ int lima_sched_task_init(struct lima_sch { int err, i; - task->bos = kmalloc(sizeof(*bos) * num_bos, GFP_KERNEL); + task->bos = kmemdup(bos, sizeof(*bos) * num_bos, GFP_KERNEL); if (!task->bos) return -ENOMEM; - memcpy(task->bos, bos, sizeof(*bos) * num_bos); for (i = 0; i < num_bos; i++) drm_gem_object_get(&bos[i]->gem);