Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757050AbeAHVs7 (ORCPT + 1 other); Mon, 8 Jan 2018 16:48:59 -0500 Received: from terminus.zytor.com ([65.50.211.136]:58609 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752944AbeAHVs5 (ORCPT ); Mon, 8 Jan 2018 16:48:57 -0500 Subject: Re: [PATCH] arch/x86/boot: sizeof macro To: Ingo Molnar , Andy Shevchenko Cc: Saidgani Musaev , Thomas Gleixner , x86@kernel.org, Linux Kernel Mailing List References: <20171229183015.7772-1-cpu808694@gmail.com> <20171229194614.3iku5zg5oglrd2cl@gmail.com> <20180106115020.abragiirty5edis5@gmail.com> From: "H. Peter Anvin" Message-ID: <202c72f5-3cf3-472e-8ecf-0f388fb0ef9f@zytor.com> Date: Mon, 8 Jan 2018 13:44:24 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180106115020.abragiirty5edis5@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/06/18 03:50, Ingo Molnar wrote: > > We probably don't want to change then, and my point was that 99.8% of the current > usage is as a 'function': > > triton:~/tip> git grep 'sizeof(' | wc -l > 116570 > > triton:~/tip> git grep 'sizeof [:alnum:]' | wc -l > 177 > > i.e. your patch moves it in the exact wrong direction. > The bottom test is bogus as it is fairly common to do "sizeof *foo" in addition to "sizeof foo": : tazenda 139 ; git grep -P 'sizeof\s*[^\(\s]' | wc -l 2085 ... but it certainly doesn't change the fact that the kernel coding style is quite unambiguous. However, I don't think it makes any sense to patch just for the sake of patching. I personally like the additional visual clarification (backed by compiler assertion) that the argument is specifically an object, not a type ("sizeof type" is invalid), but that's not the prevalent use in kernel code. -hpa