Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbdIOVCY (ORCPT ); Fri, 15 Sep 2017 17:02:24 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:56692 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbdIOVCX (ORCPT ); Fri, 15 Sep 2017 17:02:23 -0400 Date: Fri, 15 Sep 2017 14:02:19 -0700 (PDT) Message-Id: <20170915.140219.188567213297726189.davem@davemloft.net> To: himanshujha199640@gmail.com Cc: Yuval.Mintz@cavium.com, Ariel.Elior@cavium.com, everest-linux-l2@cavium.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] qed: remove unnecessary call to memset From: David Miller In-Reply-To: <1505215162-3917-1-git-send-email-himanshujha199640@gmail.com> References: <1505215162-3917-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 15 Sep 2017 14:02:22 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 493 Lines: 21 From: Himanshu Jha Date: Tue, 12 Sep 2017 16:49:22 +0530 > call to memset to assign 0 value immediately after allocating > memory with kzalloc is unnecesaary as kzalloc allocates the memory > filled with 0 value. > > Semantic patch used to resolve this issue: > > @@ > expression e,e2; constant c; > statement S; > @@ > > e = kzalloc(e2, c); > if(e == NULL) S > - memset(e, 0, e2); > > Signed-off-by: Himanshu Jha Applied.