Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4746115rwb; Wed, 17 Aug 2022 05:33:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4WH3bg5g5eRQJPeJU6s6EF42PLr2mpYU/iJuP5V3npEhw6h7vvG6MoziG6rQTy/q874mAD X-Received: by 2002:a17:90b:681:b0:1fa:7c0d:2480 with SMTP id m1-20020a17090b068100b001fa7c0d2480mr3444063pjz.142.1660739636419; Wed, 17 Aug 2022 05:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660739636; cv=none; d=google.com; s=arc-20160816; b=pqUBvKukehydJUUZVIC9tqkV3JukMLm4kFtQ2MavzFNRft9MfpKfXMY41o7ZVgI1Lk Ik6m0pzK2YO7d3fRWIEy1z6EQbLIlRAU7ANKs9Zt7N6ccj6Nduw7ug86q0BHtQhZXVdg /V47DObjQTZSoQTV2QrW8yPWubiytkDJDxmGWnF45B2fMSbtu1SUvVRdi4RNGfGSsihz D2Cw9FD7FISr7pneHBMy1YeGMUDu7a1nPTnQ5grjdo244QxMc3yx7nAb4qH2HsjCEDuw CJR7KNlnROY/pN6lxEjcl0CZE0e8aisDXNDQKLqdKq8d7AtOI6XnOakf16AZIja+bGrf IVCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=T4H8g2TlTdIU/Bg666ljfBRAWBNZM0kKOI8uoeGDhqA=; b=TJpHspz0LAzTBXSc6sGAf4FSc64Q8YjNMubHrg+8OlaU4fqPpgKpqVGCLdFoEzTxbF sXtkdZevNJeEUUKSk/1lfjdr9fFLARikYzVrjqiCjgv3EgUbd4BIwFcrIbwJMDAK0Brh Bx43RXB8cJyJR6De09c9LSUwf4Zi2e3dUbwQbj4uk3hkublhEN2Y9CNra5EqPp3UrGPd c/4OSpj+WD/5wgkbuFy019JVpxJU5iL+QNo6DEDRAi7KssERvBm6jt0AUk+NDytZgip0 pqnt1ZFSznAv49cz0AsIYXuZ337N1ZIuky4DpxXMoOBQZcxeipgRe89IcZQdRE/xijeV wpug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vekllf6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd33-20020a056a0027a100b00534b6674cb4si11672349pfb.301.2022.08.17.05.33.44; Wed, 17 Aug 2022 05:33:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vekllf6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239429AbiHQMZF (ORCPT + 99 others); Wed, 17 Aug 2022 08:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238987AbiHQMY5 (ORCPT ); Wed, 17 Aug 2022 08:24:57 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D57B38607A for ; Wed, 17 Aug 2022 05:24:54 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id f8so2324716wru.13 for ; Wed, 17 Aug 2022 05:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=T4H8g2TlTdIU/Bg666ljfBRAWBNZM0kKOI8uoeGDhqA=; b=Vekllf6tqfbB+9Q/yUgB3FBfiJ9DOjYkyFR44o3kjziHjzATgnHjz7QGPif7PzdAe7 7SaN+bClZ26ixBs+3IB/cq6REoWpMAYpNU9xXyWJbvumABVDeeqR3+MO1qJP507ov/p/ hfQI13O8D0T/HxhIl6otICNLzyRnlMoANxe1lsF3dLYW/FsYGhvyHaCpRf7YXHOyw1hv ernb4vn6gURXO1Xw24ofDPAzFUJgn4Hz3ePnlYBAYesioB+J3lqDD2hdkwFbC7cz1EuO 3zeaaxRJcsa/ZeAifJZC4TBUu/k2mrvE1moCti4e/BtXbXTFj1tGijtKr1eq4KCh78wf kMiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=T4H8g2TlTdIU/Bg666ljfBRAWBNZM0kKOI8uoeGDhqA=; b=G0P/QlX9Dl1IjfvAAOuedvZZW6xANpTFgZP5KP1B36RgvdIcNH2niHMRbQ6BbObEhV UIIBNBDN86VsdVHMqmcC9/KFeMfwjFrfJc2mY+42n59mLaPoH2fNCPVZ1IUYkRpXrVry XoF8Xio1jLrW2WopInfybONUjB3GKEzdBcwxaVk2IcO6z62P5Qx/1cLITB//87g+0C5K i1H4y/sJnkdT/JjGqM8bNSB+KR0pkZ1trTCY5ijPzOhnKzy3W6x2vzMySZTbOa60wgPT rajsfud9lYRUcgqr+uOjFURQFb/3wV9PT6J+LTSU067/B4PjataEe9hoVGYEEn/8J3EO 2tJw== X-Gm-Message-State: ACgBeo1fIpKbfnYiQpjnAldBAi4GZunsjTtKMiNA/Cze01nGwRNSzrL7 nFbrkQ1QiSl8N1uhxr7LEAm2AT7u99yoBA== X-Received: by 2002:adf:db06:0:b0:220:7a57:6665 with SMTP id s6-20020adfdb06000000b002207a576665mr14515643wri.55.1660739093084; Wed, 17 Aug 2022 05:24:53 -0700 (PDT) Received: from [192.168.86.238] (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.googlemail.com with ESMTPSA id b3-20020a05600010c300b002217339ce90sm12947959wrx.8.2022.08.17.05.24.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Aug 2022 05:24:52 -0700 (PDT) Message-ID: <601d9f11-254b-ece9-df61-e6a352f520d0@linaro.org> Date: Wed, 17 Aug 2022 13:24:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] nvmem: brcm_nvram: Use kzalloc for allocating only one element Content-Language: en-US To: Kenneth Lee Cc: linux-kernel@vger.kernel.org References: <20220810031037.2620221-1-klee33@uw.edu> From: Srinivas Kandagatla In-Reply-To: <20220810031037.2620221-1-klee33@uw.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/2022 04:10, Kenneth Lee wrote: > Use kzalloc(...) rather than kcalloc(1, ...) because the number of > elements we are specifying in this case is 1, so kzalloc would > accomplish the same thing and we can simplify. > > Signed-off-by: Kenneth Lee > --- Applied thanks, --srini > drivers/nvmem/brcm_nvram.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c > index 450b927691c3..4441daa20965 100644 > --- a/drivers/nvmem/brcm_nvram.c > +++ b/drivers/nvmem/brcm_nvram.c > @@ -96,7 +96,7 @@ static int brcm_nvram_parse(struct brcm_nvram *priv) > > len = le32_to_cpu(header.len); > > - data = kcalloc(1, len, GFP_KERNEL); > + data = kzalloc(len, GFP_KERNEL); > memcpy_fromio(data, priv->base, len); > data[len - 1] = '\0'; >