Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751177AbdLaQdN (ORCPT ); Sun, 31 Dec 2017 11:33:13 -0500 Received: from smtprelay0253.hostedemail.com ([216.40.44.253]:50998 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750962AbdLaQdM (ORCPT ); Sun, 31 Dec 2017 11:33:12 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4031:4321:4605:5007:7514:7903:9108:10004:10400:10848:11232:11658:11914:12049:12555:12679:12740:12760:12895:13069:13161:13229:13311:13357:13439:14181:14659:14721:21080:21627:30041:30054:30060:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: line11_9021a6ff9e80f X-Filterd-Recvd-Size: 2117 Message-ID: <1514737989.1967.24.camel@perches.com> Subject: Re: [PATCH] arch/x86/boot: sizeof macro From: Joe Perches To: Andy Shevchenko , Ingo Molnar Cc: Saidgani Musaev , "H. Peter Anvin" , Thomas Gleixner , x86@kernel.org, Linux Kernel Mailing List Date: Sun, 31 Dec 2017 08:33:09 -0800 In-Reply-To: References: <20171229183015.7772-1-cpu808694@gmail.com> <20171229194614.3iku5zg5oglrd2cl@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 982 Lines: 32 On Sun, 2017-12-31 at 13:48 +0200, Andy Shevchenko wrote: > On Fri, Dec 29, 2017 at 9:46 PM, Ingo Molnar wrote: > > * Andy Shevchenko wrote: > > > > - ireg.cx = sizeof buf; > > > > + ireg.cx = sizeof(buf); > > > > > > sizeof is operator, not a function. > > > So, what are you trying to achieve? > > > > That's true, but in the kernel coding style we use it as a function: > > Yeah, the question is do we need to change all those 177 occurrences at all? There's actually around 900, for ~100:1 ratio $ git grep -P "\bsizeof\s+\w" -- "*.[ch]" | wc -l 907 $ git grep -P "\bsizeof\s*\(" -- "*.[ch]" | wc -l 117203 About half of these occurrences are in 3 paths and their actual uses of sizeof without and with parenthesis are: drivers/infiniband/ 212:3696 drivers/media/ 111:5058 drivers/usb/ 121:2006 > Or perhaps it might be an opportunity during some other changes to > certain users... Perhaps best that way.