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_ADSP_CUSTOM_MED,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 5A4D8C433ED for ; Thu, 20 May 2021 15:49:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 DD8D360C41 for ; Thu, 20 May 2021 15:49:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD8D360C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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=desiato.20200630; 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=Hz8nSGY3q6/O3OJ/P3S8TRgB/rGT12P5e2HYFtYNmPk=; b=mW7YNf/K8gMRWCbJcb0LOs0ZMK ZSW80I+2UEuXb7NIhJA8+0mPY8wTSKvePF0ENBLCYb/w2egqo+b10AMmOMNR6nqThIdRkbhVPFIeo jaMSRNmPP7OvhVfoW/x2FZ83aGTEpO4m5kNHKfbUsrwvFmxDm5yjmz9I6h0RQ/hxiAlW24BZDtrbn 0d1rol5dEZKJxoc6+ZfFlTb1UPkk6CNjl/hylSKMVSK8j0htfVs/0XmEbdgnfdwbQe2R4+GHXoj4j TEYUNRud8DoC+4V6z8fJDnc6VxJzT6F859sXCczfKQmdLbWJjyhbdNKDFs8webL6FHHRK5nDxvk6B MToYTQCg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkty-001lUE-Sh; Thu, 20 May 2021 15:47:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljktt-001lSc-O7 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 15:47:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TbJQOEEFF/+nf1KiXSLwJcY/vwU+LRKGaCo1IHQgEHk=; b=0lG69CjsWi980zeknQv1WXBgdK Ix26bMbAyFsGqIEgNNfKkPRw0h5tv2MOBJ8/HE78hD1yjlzp4uoFV1i762jeMZs9pg1txgQGpHPM3 7Z/hXAVtC95ehlsoZQrsFw78yn1QN+fZzEayoMX3HPc9sV+Eq0y+m9LPtk748cQoQcpaKy6CD9838 gop5Wy3nr+A2um3ymcMUNU6DbRNqMuo7DU2s+KQlOJwhXygVkGh6KR9BdAKARd9OzfpoxulxkJR4J /l4O1beXzBjSroNIqyy+UdoTvWgcoVT1GBMT3XEU6fs7N5DLn01ArravzCfHf8yr167fFL4AXTKtP lDBXaEMQ==; Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljktr-00GTrt-6Y for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 15:47:52 +0000 Received: by mail-pl1-x629.google.com with SMTP id t9so861023ply.6 for ; Thu, 20 May 2021 08:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TbJQOEEFF/+nf1KiXSLwJcY/vwU+LRKGaCo1IHQgEHk=; b=nc9d59urRD2gADVZIakW9AaJC1C5aS/uZY9a449dXEeqz33LeD3zgBoFymK/FFzx9W 8UMLGr5qQ1Opl1RnjvIZ6C9oBra3dAeV44x+HMZgRPUb+HQxs2/27kS9SCrLMM42SsDE FnSSqxYyqy07U4oIZlH9vBaexa9vFQtM+SZTp7/kQtYKYom/1FojUrbkRlk0cziddX39 IGt7QouHuVRYLfDXlip7ZuNP1HLcDP81qreveh8VZWPPjps1Jj5vRA50bDfk6i4vB5i2 zn6rIuJFLxJvM/AgFYkEAL2phrdzLXl7hqu0s45hITCo4o2Y7zUpaoplgH8O2oPD0QtS ltMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TbJQOEEFF/+nf1KiXSLwJcY/vwU+LRKGaCo1IHQgEHk=; b=iXM7Rv3Zf8tuSDKt//QF56uCuYyasqjzTfHBHqPm5at7wglPJIZ2DC50t5ElRjsdRM Xue6yyXrclpLtrxtbgO0nn8Qo8wYnjyWHh0YZiuKFsZsBLL305rp2/chnSeccumPkm9d ++sGGnAsoNUuCzE0oaDD33I09EZXRV3C1YPjaD+T/GLqUztkb+jq1PRBOiaD0g3wQQdm L+g9W8y8sMbP2l/uk+B7xa47FHI/1LLVrj0kpAXZCCywf+r/teSH7fQlBDDAtYBKyyYa KKdVd7lUuXBt6nmUzoYj0TWBj4TM/ObSbcvq5WhPgxM4qOfiptig6ekAPivL1wkFpNcY rOsA== X-Gm-Message-State: AOAM533E2CrufNiai7x7zLAJF706o22IdyyXXSHIBWtf57cCyefLrziZ Dkand/h8QiCp4eG1Fk087DatVg== X-Google-Smtp-Source: ABdhPJxTM/jRG6LA6ksVCqvmEyYOIRv/ZFqP16D9FpSI6ufCXuMAETXrh9UrMjmvWOGKuc+j4Z/ITw== X-Received: by 2002:a17:90b:1902:: with SMTP id mp2mr5550488pjb.176.1621525669947; Thu, 20 May 2021 08:47:49 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id c191sm2278922pfc.94.2021.05.20.08.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 08:47:49 -0700 (PDT) Date: Thu, 20 May 2021 15:47:46 +0000 From: Sean Christopherson To: Joe Richey Cc: trivial@kernel.org, Joe Richey , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Mark Rutland , 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: References: <20210520104343.317119-1-joerichey94@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210520104343.317119-1-joerichey94@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_084751_281877_2A88D838 X-CRM114-Status: GOOD ( 20.05 ) 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 Thu, May 20, 2021, Joe Richey wrote: > From: Joe Richey > > The BIT(n) macro is used in the kernel as an alias for (1 << n). > However, it is not defined in the UAPI headers, which means that any > UAPI header files must be careful not to use it, or else the user > will get a linker error. For example, compiling the following program: > > #include > #include > > // Detect if FSGSBASE instructions are enabled > int main() { > unsigned long val = getauxval(AT_HWCAP2); > return !(val & HWCAP2_FSGSBASE); > } > > Results in the following likner error: > > /usr/bin/ld: /tmp/cceFpAdR.o: in function `main': > gs.c:(.text+0x21): undefined reference to `BIT' > > 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 Any reason not to provide such a patch in this series? :-) > Currently, the script actually _encourages_ users to use the BIT macro > even if adding things to UAPI. > > Running `rg "BIT\(" **/uapi/**` shows no more usage of BIT() in any > UAPI headers. Tested by building a basic kernel. Changes are trivial. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel