Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4386811imm; Mon, 8 Oct 2018 21:39:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV62E9uOk7H8Td+iX7UuiccPcJEjzOhbabB8qk3Epd4sRXUCUYZzuh3algZUFECoXnlu+vmxb X-Received: by 2002:a62:adc:: with SMTP id 89-v6mr28317691pfk.56.1539059990694; Mon, 08 Oct 2018 21:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539059990; cv=none; d=google.com; s=arc-20160816; b=Dw79XwKuZp3o+ZvJ3PJVfihfMx3XGEHAGIH0bCaPwCkZd7NmLcNUsfKXg+hJtbbMXN Y/RoPrCq+EEyLRXvhsjRbqzu9+hM7d+qOhwkPhugbYQdNDKiQC2vGkvVZsvESfSNAuJy WxXPH6oXKLhr89JY6oq910DAXDQXSQ1xjj2Oh1wAn6jXKz2YcN6VaOAbfp4Fp4lZYtTd x2/VH3g1MdPML18kYNuGcjifqAG1lau8Lhdtg84bviroce9YXVvHNpIhUDkAdyfCr244 +7FduDWf+Ch3cuY5mFzYTwTvSbNycLOParinwVjYCw8L0jKkT/Bcgqb3DiBwnux+1cXM fKcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=7dczPlkczaRZ44xrJbZ5xzfvpDobxjUwJQ7ElNnDSP8=; b=MFwsjPpEsA1Fpsp1ceTmaRLPPTGu0xT/Go/0ZQvBaHqqb6aDS9zYWmBh5SEOY4oUoh PUC1xdNbUfSyPJBovMGNypxJ6XY3x5AzOAoXEXOgcFF4yzn4NaMc+/kzwRQ7kwLLkNVh P9IipTIkSq+AniLJl6xIzM1lIQIg/UXUjM++iap4J1BYCjQQS1oj+0Q8KBuVmSTWI+zq 5UbJGQjobiwMd+ZAh5x1lo9FCo9H8/4rfhsIkTMzo4ZfrmPeP1ULcfK2RLgz0U+g7kQk Y+8zJ94tHbyzXOpiYrYOJxfK5N7XrHiRG9zrr24QZiyKncR/1g/G/u8fiUgjRWbzSPUc NZpA== 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 l22-v6si18495624pgh.593.2018.10.08.21.39.23; Mon, 08 Oct 2018 21:39:50 -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 S1725947AbeJILxo (ORCPT + 99 others); Tue, 9 Oct 2018 07:53:44 -0400 Received: from smtprelay0249.hostedemail.com ([216.40.44.249]:45784 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725803AbeJILxo (ORCPT ); Tue, 9 Oct 2018 07:53:44 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id D9563100E86C4; Tue, 9 Oct 2018 04:38:43 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:599:800:960:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2689:2828:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:9025:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12438:12740:12760:12895:13019:13069:13311:13357:13439:14181:14659:14721:21080:21324:21627:30012:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: glue43_864aa42fe6b16 X-Filterd-Recvd-Size: 2264 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Tue, 9 Oct 2018 04:38:42 +0000 (UTC) Message-ID: <5f968a498c3d9848389ce5c6e04d98fc59c6438a.camel@perches.com> Subject: Re: [PATCH] powerpc/xmon/ppc-opc: Use ARRAY_SIZE macro From: Joe Perches To: Michael Ellerman , "Gustavo A. R. Silva" , Benjamin Herrenschmidt , Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Mon, 08 Oct 2018 21:38:41 -0700 In-Reply-To: <874ldv3hty.fsf@concordia.ellerman.id.au> References: <20181004171036.GA1907@embeddedor.com> <8e2f906a85c3cfe0715982370a6d96f08a37987c.camel@perches.com> <874ldv3hty.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-10-09 at 14:43 +1100, Michael Ellerman wrote: > 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/ Don't expect people to remember this. > Is there some way we can blacklist this file from checkpatch, Coccinelle > etc? Modify both to look for some specific tag in a file and then update the scripts to read the file when looking at patches too. Otherwise, no.