From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE1B6C47085 for ; Mon, 24 May 2021 18:52:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA94E61413 for ; Mon, 24 May 2021 18:52:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA94E61413 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CwPQIAsyQ0Wq8L6rZbMkLpnxSz9c8bKVU/W+qqdW1z8=; b=O1KITmauDMs9aS zCH52UVFI9j5Bzk6/kE6cL40P6revSNTcCDE7L5KTBLrqveRihwjJPF/Sm/pMU8dhSH4Q8+2Jt4um +ENqgVDMpFIymF9k9d17ehadGAxBDXPAoKzxa+kmYQV5HiYCbI0YpEO+KdQ2VX1fS1ozKEqljHCbD wIf7hXtgcwJD+RurljlFlQwoIAVbTAeNauzRzX/bFOlbbt4ilTQq/DbkpvMPzQh42BAHxT9FKzG6E RjESnwuqnFBFAOW39GN5+7b1GeXICmBc8cWBgYAWxK5tzt1swCME6em2VouGWBGG/h+H0Wf7ifQx6 9Ksqmw8i419R5dvoQoYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llFeM-001XY0-6j; Mon, 24 May 2021 18:50:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ll9hr-000ufQ-QL for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 12:29:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02C2C113E; Mon, 24 May 2021 05:29:09 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.38.161]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D91A03F719; Mon, 24 May 2021 05:29:04 -0700 (PDT) Date: Mon, 24 May 2021 13:29:01 +0100 From: Mark Rutland To: Christoph Hellwig Cc: Joe Richey , trivial@kernel.org, Joe Richey , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Lorenzo Pieralisi , Mauro Carvalho Chehab , Zhangfei Gao , Zhou Wang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-accelerators@lists.ozlabs.org Subject: Re: [PATCH 0/6] Don't use BIT() macro in UAPI headers Message-ID: <20210524122901.GH1040@C02TD0UTHF1T.local> References: <20210520104343.317119-1-joerichey94@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_052915_908594_CFE28D42 X-CRM114-Status: GOOD ( 17.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 24, 2021 at 12:46:26PM +0100, Christoph Hellwig wrote: > On Thu, May 20, 2021 at 03:43:37AM -0700, Joe Richey wrote: > > This patch series changes all UAPI uses of BIT() to just be open-coded. > > However, there really should be a check for this in checkpatch.pl > > Currently, the script actually _encourages_ users to use the BIT macro > > even if adding things to UAPI. > > Yes. In fact it should warn about BIT() in general. It is totally > pointless obsfucation that doesn't even save any typing at all. That's not quite true; the point is that if you use BIT() consistently, then even when you refer to bits 32 to 63 you won't accidentally introduce shifts of more than the width of int, and the definition will work equally well for assembly and C, which isn't true if you use `1UL` in the definition. With that in mind it's shorter and clearer than its functional equivalent: BIT(x) (UL(1) << (x)) So IMO it's preferable to use BIT() generally, or _BITUL() in uapi headers. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel