Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4349950imm; Mon, 8 Oct 2018 20:44:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV62WtVsoOCsk1Okm/o2odAXRV+drfE/4APKl4CI0AsyL23jBrcNnP+QEL2bHCWdmmKV3e1jB X-Received: by 2002:a62:9c8c:: with SMTP id u12-v6mr27917758pfk.162.1539056678417; Mon, 08 Oct 2018 20:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539056678; cv=none; d=google.com; s=arc-20160816; b=TOZhUGSMly9ceJ7rlWVlzp4pbf3wyjOgOE+KK4f4+xI14X8q0dsVoEPayDFpjj7K3y 0OS/QJpvEprKF64vg7L8RUT+x19/xk/OgvTGoPa6Ln2YdLDEYoeOwVq/+RRPcK1JtjHq 5lyFV951q7unHEZelbe5L7kCNBImYfLcORRL+43JX0nEe1wi5i8VQ3CY1Z98AZuSXd62 JKTSHyPyDuNGkSZFv8ND+qIU3xs5XONrW+n971/DATvPVpp2+b3rNQ0WoDYMv1NdkgOH vdRohURc3bGkDgFpeMyz/J0pA0A2X8NDunbb/EDqXGgNFlzfrZuRhERdWLURCcNUXDMb c/2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=d8XlXKZROh9JKJ7ZZL9oM5O0ErP0T1UIwN/hcct2zEA=; b=yzm8cPhkj8V2aPx5BjPGpevLvX9goZ+lE+qTQEA7U6PVe03uqZXY1rFALmTo2beYQf 2jdifPn0O1lFBjhlXUmwE1RbOvLEKEBWI4hrbH5HVoohPRJjOH10B1gMYZ8PbLOvQyXk Y52aeoZl3cV8nMXEIuR+Z1Kqjt6ZlL+0kouE2RBQe3RjU7+foQwKkAeC5WAtpHkYyrGy nn92AfjQpPaQr1276+Te00V0TFa+BscsnrTeXRAd07M07poqoBgrjvkXo17E3qDSuv8F +MlRHIfRqbFLhLLSCc1yQ+3yPiWHbaSrtS2XQ7Q5XyxjJy31VPmddTCb4qQnP4wAEMV+ L7/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20-v6si18591787pgk.190.2018.10.08.20.44.23; Mon, 08 Oct 2018 20:44:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbeJIK6r (ORCPT + 99 others); Tue, 9 Oct 2018 06:58:47 -0400 Received: from ozlabs.org ([203.11.71.1]:54861 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725759AbeJIK6r (ORCPT ); Tue, 9 Oct 2018 06:58:47 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42Tjky33VDz9s7W; Tue, 9 Oct 2018 14:43:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Joe Perches , "Gustavo A. R. Silva" , Benjamin Herrenschmidt , Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/xmon/ppc-opc: Use ARRAY_SIZE macro In-Reply-To: <8e2f906a85c3cfe0715982370a6d96f08a37987c.camel@perches.com> References: <20181004171036.GA1907@embeddedor.com> <8e2f906a85c3cfe0715982370a6d96f08a37987c.camel@perches.com> Date: Tue, 09 Oct 2018 14:43:53 +1100 Message-ID: <874ldv3hty.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches writes: > On Thu, 2018-10-04 at 19:10 +0200, Gustavo A. R. Silva wrote: >> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. > [] >> diff --git 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); > > It seems this is unused and could be deleted. The code in this file is copied from binutils. We don't want to needlessly diverge it. I've said this before: https://lore.kernel.org/linuxppc-dev/874lfxjnzl.fsf@concordia.ellerman.id.au/ Is there some way we can blacklist this file from checkpatch, Coccinelle etc? cheers