Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6637787rwb; Tue, 9 Aug 2022 20:49:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BoTgmC/JylC6Ejs2xNqzQWF6goMNTtmZunRrUuXOVcVcHc08mPt24bvNf6DIrQK8L1J2A X-Received: by 2002:a17:906:8a6d:b0:730:9cd5:6688 with SMTP id hy13-20020a1709068a6d00b007309cd56688mr18315249ejc.158.1660103372488; Tue, 09 Aug 2022 20:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660103372; cv=none; d=google.com; s=arc-20160816; b=QPTPj+Slr5TftWtPhTQBXqjmtOBB78TAuvnh9jX3fMfk3/zP7P8izIcCD3czoXvq/Q UYXzJHbv5qKm2das4/R4u4tkA48Id+d82xWKzlZV29oC2r/BNnYIQKXoKWl/hF2HqVJ9 B8MbBJsPh1tM/lT3cOT0tR/RbPQ/b/oKT3gpa6PsRIr0/lYByyWQGgmD2IPsawXwnRN+ gLeSRHlIB5SJnqk5b8+THRu4vt7DJinPnD7rkw4yuzdx0560TcpFDblDPhALIOYhXaLt 1iAXORyE2RHZF+f4kWpsNnl3g23J9UNaCP6yrFkMO3LqRcZWvO25kkltEHnM1YbAAoDc 5Clw== 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 :message-id:date:subject:cc:to:from; bh=wgRgW06ejNeC7Zao5PJZPnKxoKRK6wyPRI9+5wEDpDE=; b=TKWsHI8K6HEzIvJQCIW/3hDQu/Au7IFOcMGq9xqZEvFMW4vqOUtMIe1Nm1QKdwHjrw iZgxJBqAihaOg6Gl6tvQtlb7dYYx42/SVLbSzRnqO5IP4JcLrwFBduh7Ws5PsxonICG8 KkgBPENz/91r8dRK+PNdtgjaIAfcLrcYW/gtBpNquzRhY+wIUGLjwsrd3mhJTMspWzlp VtAze78vlVVMwm3sMq23WSqaE2yDDOgbF4kZWF6YuzTFLVCRWC/bx57SCRw5OWldvD8t JP8d+YF+vF4UTvltGK5mOtUYTfCr4jY/ptJcOdhsiri70KthR5wwMg6W0OEjjwR5cuEH OhkA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=uw.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr7-20020a1709073f8700b00732f74749d1si3662758ejc.911.2022.08.09.20.49.06; Tue, 09 Aug 2022 20:49:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=uw.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiHJDfm (ORCPT + 99 others); Tue, 9 Aug 2022 23:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiHJDfL (ORCPT ); Tue, 9 Aug 2022 23:35:11 -0400 X-Greylist: delayed 1461 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 09 Aug 2022 20:35:07 PDT Received: from mx5.cs.washington.edu (mx5.cs.washington.edu [IPv6:2607:4000:200:11::6a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDBDA647F9 for ; Tue, 9 Aug 2022 20:35:07 -0700 (PDT) Received: from mx5.cs.washington.edu (localhost [IPv6:0:0:0:0:0:0:0:1]) by mx5.cs.washington.edu (8.17.1/8.17.1/1.26) with ESMTP id 27A3Aj4X207166; Tue, 9 Aug 2022 20:10:45 -0700 Received: from attu4.cs.washington.edu (attu4.cs.washington.edu [IPv6:2607:4000:200:10:0:0:0:8c]) (authenticated bits=128) by mx5.cs.washington.edu (8.17.1/8.17.1/1.26) with ESMTPSA id 27A3AjBd207162 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Tue, 9 Aug 2022 20:10:45 -0700 Received: from attu4.cs.washington.edu (localhost [127.0.0.1]) by attu4.cs.washington.edu (8.15.2/8.15.2/1.23) with ESMTP id 27A3AiYQ2620315; Tue, 9 Aug 2022 20:10:44 -0700 Received: (from klee33@localhost) by attu4.cs.washington.edu (8.15.2/8.15.2/Submit/1.2) id 27A3AiAT2620314; Tue, 9 Aug 2022 20:10:44 -0700 From: Kenneth Lee To: srinivas.kandagatla@linaro.org Cc: linux-kernel@vger.kernel.org, Kenneth Lee Subject: [PATCH] nvmem: brcm_nvram: Use kzalloc for allocating only one element Date: Tue, 9 Aug 2022 20:10:37 -0700 Message-Id: <20220810031037.2620221-1-klee33@uw.edu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 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 --- 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.31.1