Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp952845rdf; Wed, 22 Nov 2023 01:09:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH30pW0+lspi0+nxEE5VJIBccoMZO8u87uGIFvU5fKOvjEY8/CoKm9zvjiDU3Rc5Mr83INn X-Received: by 2002:a05:6a20:1584:b0:189:c987:76c5 with SMTP id h4-20020a056a20158400b00189c98776c5mr1913920pzj.43.1700644157796; Wed, 22 Nov 2023 01:09:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700644157; cv=none; d=google.com; s=arc-20160816; b=ZdHwXuiCsMdpJfAru88trN6UyjG0UGvVX/ib1IyiqNgGDnJalar8/9r8yqVz3YczrU +KdWir3vJS/Rxd8d6Wqq+JIN+pf+TJjxs/zVsJY3ysxHLj2gjt7H6d6K78lh7kq1xmhp LTX8GLI5f5DSTVWjNDKr6Rf1UCNhQzRfLx6PYiiKbdmAfeTBAJRBSaSsv1CVHNVo54m/ Arks0JzI97sSNoUFyUn5dXk0wZzbXfCfsvzYrRlcUCysYZJEzSqHnHmiGCIwASi8fmqQ T0Un/NL4voHsyUE0ZTlYl1pK/qyjgos8G/evqZWI/Ehb5bNigi1Gy5SYpBtVe5n7JzIz YAZg== 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=NjnJ0MCzZBQRGJ93Md5oCUlQ27Zl7jPfq3es03VU4Z4=; fh=p6qi8JiDjwQk+WLud4qqeW/yjlCvxpFlITtXk9ahEz4=; b=ladsSxuHDrX5odpN76ab559SgfwkWVxOxxP86B9G7J6WC72kN5hsT1acg69X2ik+ea AFHbvSAr78jyi8N5ZhyMANaAExIbCMdjjKac5/9467Qy1dpSEzxUnZHuuBoNhw4CQI5Z 63DMwhwOpVgsbI+Is3XNVyplvDWl9sK9K4BLSqBo0SID2Jw7TZ3APZHpwKcD0ysnoOkf 7J5T6doee3GdoAmDjeOc7MpqU635n5kZc87AX0mWa054nCrCwgoQ4sOC4qcfizmf6+NI RY67zCjMX3UTyFhbo7oDGtHDv8W4uizZRKOIwwEkMpyjEG4LyOSyTwu1JXnErRcHV4Sk YtRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q15-20020a170902788f00b001cc50c56980si12002967pll.411.2023.11.22.01.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 01:09:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E3726810F671; Wed, 22 Nov 2023 01:08:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235248AbjKVJGb (ORCPT + 99 others); Wed, 22 Nov 2023 04:06:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235252AbjKVJGQ (ORCPT ); Wed, 22 Nov 2023 04:06:16 -0500 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C1547B4 for ; Wed, 22 Nov 2023 01:03:29 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VwvWK8u_1700643793; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VwvWK8u_1700643793) by smtp.aliyun-inc.com; Wed, 22 Nov 2023 17:03:19 +0800 From: Jiapeng Chong To: mpe@ellerman.id.au Cc: npiggin@gmail.com, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] powerpc: Use ARRAY_SIZE for array length Date: Wed, 22 Nov 2023 17:03:12 +0800 Message-Id: <20231122090312.114679-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 01:08:55 -0800 (PST) Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability. ./arch/powerpc/xmon/ppc-opc.c:957:67-68: WARNING: Use ARRAY_SIZE. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7612 Signed-off-by: Jiapeng Chong --- arch/powerpc/xmon/ppc-opc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/ppc-opc.c b/arch/powerpc/xmon/ppc-opc.c index 0774d711453e..d409d6113f82 100644 --- a/arch/powerpc/xmon/ppc-opc.c +++ b/arch/powerpc/xmon/ppc-opc.c @@ -954,8 +954,7 @@ const struct powerpc_operand powerpc_operands[] = { 0xff, 11, NULL, NULL, PPC_OPERAND_SIGNOPT }, }; -const unsigned int num_powerpc_operands = (sizeof (powerpc_operands) - / sizeof (powerpc_operands[0])); +const unsigned int num_powerpc_operands = ARRAY_SIZE(powerpc_operands); /* The functions used to insert and extract complicated operands. */ -- 2.20.1.7.g153144c