Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp63076img; Wed, 27 Feb 2019 16:48:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IZSXz3bbdVxFs/seOy56TqYAi5p7boRn3J4NhYnPs04m6RzPC7HT5u9kWycQvaUO/wdb/oA X-Received: by 2002:a63:1c02:: with SMTP id c2mr5787495pgc.351.1551314911103; Wed, 27 Feb 2019 16:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551314911; cv=none; d=google.com; s=arc-20160816; b=0j3DJGH045vO4WU2DVGB2QH+pj8uCkIOLP8DALIiNh57143n0+OrfGEaS2cFWDNJy0 8kiuEp5dUdh4gGXFr/thLCoudbNyBOdGLvDUXVRRnQGmwNHAjQjuaHXEv+DSYBj4679Z POj1VTV2DPEoPECgurWmwp1wSdi2+6VpQyQkMyB8B9jF0PNAiVm2eOtfp2fXqZkx9zh3 OuduiHRDFiI/nsuXqIl0xkvE6fnkcjdG1bAKbKtKW45B9zUfDalZSPOq6uUvxNGFRhkX QsA07R2QbUP6d4qP5uYjBpwsk6dy8zuxcoo49PlvtIswKo0O4QhVUkhzDcxOkEq24XOW 6zRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H3hXfDj0PXBoFA9cGgNBp7TmibItk5rJ8IiapF7qRlI=; b=fLFltdWCCn2Nf/bbgOafu836XwJRxyqjypSz18ZS5Vzc6hD1fFzGYSu+c+AO42ZFRE DphJ//g3mjt+POBhAdo7hZ4PL8Tg53xYbECmmwMZKXBV4b5ulj+lDRO6tYwNs1Nyy1uR E38h51/NXE8WWimftnUOH0RnXFvxhr8WcA+qb/+SkM3elLVueGGbkYpVrdr2RYaANqag 3hUinnE/S0GrPp5nWsz6uSxop/gHOq0UpYOprR9YiH68FREbptK685pV8vFSHQDBM1N1 1YyWyJCiq1gBwA0z7pYBm6sDS4YOtCyyNsYq8eww52PSV3jWnb/ZQOC7mG45GNPa+q1q 1COQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FpdFsSOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cq17si19336435plb.67.2019.02.27.16.48.13; Wed, 27 Feb 2019 16:48:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FpdFsSOR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730489AbfB1Arv (ORCPT + 99 others); Wed, 27 Feb 2019 19:47:51 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38345 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730139AbfB1Arv (ORCPT ); Wed, 27 Feb 2019 19:47:51 -0500 Received: by mail-pg1-f196.google.com with SMTP id m2so8803182pgl.5; Wed, 27 Feb 2019 16:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=H3hXfDj0PXBoFA9cGgNBp7TmibItk5rJ8IiapF7qRlI=; b=FpdFsSORXTE5ALYt/FEXzffH7PDPJuT7po/2MhlkDBB//oLyzu6aeKWhqQ+awdLqqX t1arCbISgUK0YFJNR0PODGctCHdIuymlgyOCnBhLZzGYBN59S9wB+B8VvY2xYBlIkUQe /RqKqh6T3GMhyrum2Ugp5n+ZYzx3/0Dd1CgZP50Dfea7Xd/gBisQO5IfEtMz9hX+hiyk HaGA93icCJAbnMJZtFI1yIgX2y0CmFIF2SBmhyM+xJdU/4IV7FJoaq+irIe4vREsiits 5cXr/aP6Rk6Ju20tyG2SWhaUD6ExAjM4lgFl9HueMix4rPE3hIZIfTOZbl3N/glgaXW4 V8lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=H3hXfDj0PXBoFA9cGgNBp7TmibItk5rJ8IiapF7qRlI=; b=ofTHc1nkIUgKl+TZscI19CDTQlaozIZRuTyMhXwnJTqxhdr9aiyWN5FGKYt7Po6sS5 glKagXUzBW/wGWIj5cw12WM3UOzdZRjPqN8r3BwKcLlFivSbTHWFU0z0Xpc5f6v3dACA pSHOQzhsLWoB+IAjZ3sMolOIQIR88YTG/oi/XQUIAApFPgwVCMD3UvNAuSTKUHt7U4Oi f5et8nhIfoQXiYQNz7plBR9PIdNz7TN6Hb2UXjKo7WevQLwvfzVzfqAYPaLw9VfJeWR4 RfXKsmIU8G0VYWpgUoQ927bUMBH/4KuIdRZmwaIBxCpUCFKf714r4UG4C7Os2wbldanr YHtg== X-Gm-Message-State: AHQUAuZ08UP16/vfcbNmVswR/4NqJmFMqd6G1NUmFP9wObgAJVoWrToR kZO9YByjOMN9mLTGnK/4pw8= X-Received: by 2002:a65:51c3:: with SMTP id i3mr5670927pgq.45.1551314870020; Wed, 27 Feb 2019 16:47:50 -0800 (PST) Received: from bobby.localdomain ([2601:1c0:5501:37e2::87c4]) by smtp.gmail.com with ESMTPSA id a24sm21150495pfo.160.2019.02.27.16.47.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 16:47:49 -0800 (PST) Date: Wed, 27 Feb 2019 16:48:00 -0800 From: Robert Eshleman To: Robert Eshleman Cc: Tariq Toukan , "David S. Miller" , Russell King , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 7/8] net: seeq: replace kmalloc / memset(,0) with kzalloc Message-ID: <20190228004800.GA26378@bobby.localdomain> References: <5ff7bcf7b8db8daa129703e5f7b632825f25c766.1551246708.git.bobbyeshleman@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ff7bcf7b8db8daa129703e5f7b632825f25c766.1551246708.git.bobbyeshleman@gmail.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 10:09:54PM -0800, Robert Eshleman wrote: > This patch reduces a call to memset(,0) by replacing > a kmalloc call with a kzalloc call. > > Signed-off-by: Robert Eshleman > --- > drivers/net/ethernet/seeq/ether3.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c > index d1bb73bf9914..7456cf08a48f 100644 > --- a/drivers/net/ethernet/seeq/ether3.c > +++ b/drivers/net/ethernet/seeq/ether3.c > @@ -223,7 +223,7 @@ ether3_addr(char *addr, struct expansion_card *ec) > static int > ether3_ramtest(struct net_device *dev, unsigned char byte) > { > - unsigned char *buffer = kmalloc(RX_END, GFP_KERNEL); > + unsigned char *buffer = kzalloc(RX_END, GFP_KERNEL); > int i,ret = 0; > int max_errors = 4; > int bad = -1; > @@ -231,7 +231,6 @@ ether3_ramtest(struct net_device *dev, unsigned char byte) > if (!buffer) > return 1; > > - memset(buffer, byte, RX_END); Byte is not zero, so the intent of this patch does not apply here. Dropping this from the patch set in v2. > ether3_setbuffer(dev, buffer_write, 0); > ether3_writebuffer(dev, buffer, TX_END); > ether3_setbuffer(dev, buffer_write, RX_START); > -- > 2.20.1 >