Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2075061rwn; Fri, 16 Sep 2022 05:27:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5QaoBKCU1Xm0uYtThRXQxSllsNinC9ptGSZNEJ8hwm0jKHA4vtuPeF43vDFu404VVJhjkE X-Received: by 2002:a17:907:a06a:b0:77b:9167:b226 with SMTP id ia10-20020a170907a06a00b0077b9167b226mr3492031ejc.421.1663331227603; Fri, 16 Sep 2022 05:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663331227; cv=none; d=google.com; s=arc-20160816; b=A7MHQlFDFOj5wYPvxpDTwdSAVSccvTAhteh73jt1rHDFacUnu6s2gSai6B0evn7Mfb pSmKe+Nok/QZQwm1sEHjnylvj1pWJlE6cyZiSqkrwhcOS+xSiWp7G4+yGIqGmRHq7OQ7 4tQECOCrOrcCb1Sxcl6/YIjPXgAtVJUCDzL7t4r+VkUXfvn1oAdJgzWDs1NBtMXPgyJt ujn55KBM+jXER3lcRBsEO2U3gh9vJt/vE52UCBPr+69QBPOkzcGqktf8bu69sI3nvMHf /n6G0Da0fZY18l6SnsgtKsm7IFYjn9yahiIfWJZJ1FyiAIcukroRUD/IdC0dcTtNTK+W EQRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=roKqTDfIrTl9uRri+S8php+Fd9yWmb1Y8cdQ+WhhXiY=; b=Uh/tDr9xxBG7yB52y51Gn1h5TFtAzNKOx3s0VYky7NgUnjtmEbMS3duy4QIF05m/Ut OxNe+RPn6WRZrPY57NKxx6GxYKpfM37ghvMDgFYOjYk5mv2MBSBCcjkB+KPRHXSVo1R3 F0w3m9FjShuXyWFbtp5q8wQqGsl0ekhghVNvPcVnZRAxMyCOLqOMNP6Gi1oEFSdBc4jX LdjqcIXSwMBYh0pz6RiwoPbulLBcsJG4v4V8OP3RJArmLw7/WHrsIDkYJ6Wyp3485/zU aw75pvNQXt8nMKhpFCW2kZvxhEvNJRQObI1oAPtTDLCQ4ngBqyPxx3GlvZQqDBWwI4yi kpWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XXv4s6fz; 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 eb14-20020a0564020d0e00b00451c76e7a25si253328edb.211.2022.09.16.05.26.42; Fri, 16 Sep 2022 05:27:07 -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=XXv4s6fz; 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 S231559AbiIPMVx (ORCPT + 99 others); Fri, 16 Sep 2022 08:21:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231551AbiIPMVX (ORCPT ); Fri, 16 Sep 2022 08:21:23 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E4C3B1B83 for ; Fri, 16 Sep 2022 05:21:13 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id k9so35807692wri.0 for ; Fri, 16 Sep 2022 05:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=roKqTDfIrTl9uRri+S8php+Fd9yWmb1Y8cdQ+WhhXiY=; b=XXv4s6fz2yp/sVM9BNSs6pAQS67/Ovdc6+oBUAk/GIOfV3f6ZSnldpSkMVh77Kb5r+ rQ0VeXTVcju9ovRoHRSj9QSPDZdi/fRxfFMyxg4uazjPU5dZACPF5KH0g+x+hL3uA6uG qNvseJxrRhzaC2YH3Z0+SgzAncDEV32klVtuTQ7bjxTSZBvQWvnduUd1NkChqINFXDA0 jKpAatYzt/O6JdC9W+SxNv+atFYDoWlmk576tHBjuBVSz5ZAcMllg20+1wC3ShYgU/b4 u51PfPuj8i1DP3saRTXWYPEqFPjk4+fvWJNzShsl8XVkYgbx4IuEk/ibb6XDAmfEKmvw FFHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=roKqTDfIrTl9uRri+S8php+Fd9yWmb1Y8cdQ+WhhXiY=; b=AM2aoeCGaVQZGtZbdSf541yBTHfcoqV9k57VJ9vsGP0VF6KOxW56zzFya8Ltg/EIT5 htKvk347d8UI8vminZof3Lp3uL22+CUgTsgz/BLjhku/P2QQCl+ujqHCWR0pD8CEdra9 9VPo//fUuQ6MNANgB6R6f8r7xSFatCQopjlpre9sJ6D4tV+dJWzpA60nzUABFmJfZL/7 Pf6Sh2xqLNDOrdcY5qcG1kZaCqcS6tGOpFo8p0Oc930oJynxpJfjpwtT04YlsGuOOsE1 XuYveeRv4lw8aLW+nquI01gEWk2xRGWvIHf0zZl6wuMh0d8AbBJNHJrP6afrzLU4Dsz5 SQ7w== X-Gm-Message-State: ACrzQf0lZ+a3m8Dx/QX/ETIPYV43iCvCOTwOTjJfyzh0ezJ3HE905QCt 3O8xWbcWGHz0IO0VnVCwuty9Rw== X-Received: by 2002:a5d:69cf:0:b0:22a:c2d3:1d4a with SMTP id s15-20020a5d69cf000000b0022ac2d31d4amr2735175wrw.473.1663330872063; Fri, 16 Sep 2022 05:21:12 -0700 (PDT) Received: from srini-hackbase.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id u11-20020adfdb8b000000b0022add371ed2sm1540015wri.55.2022.09.16.05.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 05:21:11 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Kenneth Lee , Srinivas Kandagatla Subject: [PATCH 05/13] nvmem: brcm_nvram: Use kzalloc for allocating only one element Date: Fri, 16 Sep 2022 13:20:52 +0100 Message-Id: <20220916122100.170016-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916122100.170016-1-srinivas.kandagatla@linaro.org> References: <20220916122100.170016-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 From: Kenneth Lee 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 Signed-off-by: Srinivas Kandagatla --- 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'; -- 2.25.1