From patchwork Sun Nov 13 09:29:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 19314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1615578wru; Sun, 13 Nov 2022 01:46:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf44PXRYyA0XuwgU7dD0me881ASNL72ecWgfd5oMZiLSjpVo84sTwMXPKHv5zm9Zih6ViPVQ X-Received: by 2002:a17:90b:3c44:b0:214:1648:6879 with SMTP id pm4-20020a17090b3c4400b0021416486879mr9407748pjb.168.1668332811245; Sun, 13 Nov 2022 01:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668332811; cv=none; d=google.com; s=arc-20160816; b=ktDG4RmxmGF8xPkoBPngPQ+sJnvUsBCa+OFgoawhpS8t/rX7UUCBJKIK/veYjk+x2v fTrA9ijVoD6CeRYFkWINLXDLafkemfyxeO5yWZjGEzAB3Pm542hyY/0m9TeWLbNoTpp0 S/wExidWTfYJ4Vh1GmIoyI5KmWiR/l4HPiltMsncWH7LCRxHX91gDyAtYwTtBp4BpmFY k/lJEiy0DznbqsWlVIku6oloS4x377SK3hKbvXEvvTqwVJw/xDAbgfwjHPx8fhcbEA5q wzAcsauWzOn0MRIhBwyv11iclgRHKPairwqkME6nDG1AKSi4RAMuKB8b8p1V/lg+M080 9NnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=AZsFMF2U2+MLxGdAt4lGkJQpphYgfZ4gq4itdMQcYv8=; b=ShBKKT+SpKS2oAPYGqLBKteczkyiqLJ79Op6Q91ugyQ3OmTnXHQxyUHIX3eR+hYUig 9KGbNlQxt5OESJCxMw9PIJIgsiXW/+cP6gZ6bW/TsszBKXjQmsnYM6yYLsKN+dr+aUXI Fp1c1evt8XR0y+yKBrD6fJm7skdtADe7p/oAFGRIDp/Uv3+e73a+M61jaihnenBHhUOu 3PmhwD9HygqCRu+7GTWVA4uAmVONpeMsdadFyj1hBm2g+xzyfRpZkL5dRl2r2uYv5DcY YYNwQ+3BzsWrvRIfgygqLxjqToYkUMI9tfr0xA9WNDYpYXh3icrR7RrVlkla7tTi4TI+ U7Hg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a63f554000000b0046fe97419aasi7373720pgk.120.2022.11.13.01.46.35; Sun, 13 Nov 2022 01:46:51 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235215AbiKMJe5 (ORCPT + 99 others); Sun, 13 Nov 2022 04:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiKMJey (ORCPT ); Sun, 13 Nov 2022 04:34:54 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5D8BFD49; Sun, 13 Nov 2022 01:34:53 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 13 Nov 2022 17:29:50 +0800 (GMT+08:00) X-Originating-IP: [182.148.14.167] Date: Sun, 13 Nov 2022 17:29:50 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: masahiroy@kernel.org, michal.lkml@markovi.net, ndesaulniers@google.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: fix array_size.cocci warning X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <4d274d11.12d.1847052e009.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwB3jOIOuXBjwBoDAA--.79W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAEB2FEYx0DfwATs2 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749373745397534907?= X-GMAIL-MSGID: =?utf-8?q?1749373745397534907?= Fix following coccicheck warning: scripts/mod/sumversion.c:219:48-49: WARNING: Use ARRAY_SIZE scripts/mod/sumversion.c:156:48-49: WARNING: Use ARRAY_SIZE Signed-off-by: KaiLong Wang --- scripts/mod/sumversion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 6bf9caca0968..31066bfdba04 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -153,7 +153,7 @@ static void md4_transform(uint32_t *hash, uint32_t const *in) static inline void md4_transform_helper(struct md4_ctx *ctx) { - le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(uint32_t)); + le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block)); md4_transform(ctx->hash, ctx->block); } @@ -216,7 +216,7 @@ static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len) le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - sizeof(uint64_t)) / sizeof(uint32_t)); md4_transform(mctx->hash, mctx->block); - cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t)); + cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash)); snprintf(out, len, "%08X%08X%08X%08X", mctx->hash[0], mctx->hash[1], mctx->hash[2], mctx->hash[3]);