This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Fri Apr 26 22:01:36 2024 >From mailfetcher Thu Dec 7 12:01:45 2017 Envelope-to: lkml@grols.ch Delivery-date: Thu, 07 Dec 2017 12:01:44 +0100 Received: from srv.grols.ch [5.172.41.101] by 0359fc81c977 with IMAP (fetchmail-6.3.26) for (single-drop); Thu, 07 Dec 2017 12:01:45 +0100 (CET) Received: from vger.kernel.org ([209.132.180.67]) by home.grols.ch with esmtp (Exim 4.89) (envelope-from ) id 1eMtw0-0008D9-DH for lkml@grols.ch; Thu, 07 Dec 2017 12:01:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbdLGLBm (ORCPT ); Thu, 7 Dec 2017 06:01:42 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48857 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbdLGLBm (ORCPT ); Thu, 7 Dec 2017 06: Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1eMtvq-000490-MT; Thu, 07 Dec 20 From: Colin King To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Balbir Singh , linuxppc-dev@lists.ozlabs.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/xmon: use ARRAY_SIZE on various array sizing calculations Date: Thu, 7 Dec 2017 11:01:34 +0000 Message-Id: <20171207110134.22566-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Received-SPF: none client-ip=209.132.180.67; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: 4.8 X-Spam-Score-Bar: ++++ X-Spam-Action: greylist X-Spam-Report: Action: greylist Symbol: FORGED_RECIPIENTS_MAILLIST(0.00) Symbol: RCVD_IN_DNSWL_HI(0.00) Symbol: RCPT_COUNT_SEVEN(0.00) Symbol: DMARC_POLICY_SOFTFAIL(0.10) Symbol: BAYES_SPAM(4.00) Symbol: MIME_GOOD(-0.10) Symbol: PRECEDENCE_BULK(0.00) Symbol: ASN(0.00) From: Colin Ian King Use the ARRAY_SIZE macro on several arrays to determine their size. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- arch/powerpc/xmon/ppc-opc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/xmon/ppc-opc.c b/arch/powerpc/xmon/ppc-opc.c index ac2b55b1332e..f3f57a12d43b 100644 --- a/arch/powerpc/xmon/ppc-opc.c +++ b/arch/powerpc/xmon/ppc-opc.c @@ -966,8 +966,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. */ @@ -6980,8 +6979,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"fcfidu.", XRC(63,974,1), XRA_MASK, POWER7|PPCA2, PPCVLE, {FRT, FRB}}, }; -const int powerpc_num_opcodes = - sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0]); +const int powerpc_num_opcodes = ARRAY_SIZE(powerpc_opcodes); /* The VLE opcode table. @@ -7219,8 +7217,7 @@ const struct powerpc_opcode vle_opcodes[] = { {"se_bl", BD8(58,0,1), BD8_MASK, PPCVLE, 0, {B8}}, }; -const int vle_num_opcodes = - sizeof (vle_opcodes) / sizeof (vle_opcodes[0]); +const int vle_num_opcodes = ARRAY_SIZE(vle_opcodes); /* The macro table. This is only used by the assembler. */ @@ -7288,5 +7285,4 @@ const struct powerpc_macro powerpc_macros[] = { {"e_clrlslwi",4, PPCVLE, "e_rlwinm %0,%1,%3,(%2)-(%3),31-(%3)"}, }; -const int powerpc_num_macros = - sizeof (powerpc_macros) / sizeof (powerpc_macros[0]); +const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros); -- 2.14.1