Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp87857pxj; Thu, 20 May 2021 05:10:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRRAye66iAtLWJZKE996kiQp/vtZmb5H3aLX4575o3RabFKQDgofVHFhN1mc297fk57yp4 X-Received: by 2002:a17:906:f283:: with SMTP id gu3mr4357412ejb.91.1621512656543; Thu, 20 May 2021 05:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621512656; cv=none; d=google.com; s=arc-20160816; b=VOIKB/vbliTmJ4fTG9DAjJ/hhQ4Ra95+JyKS9lZIMIMODAzd9PWwGWhCP2zjgDWMg0 hmlBujN9yfnrPaCMqfP6TuVJ8iJ4RibEalir1x7mPVuV5/+vO2h7bzVqCr+7wSpx2etw ZB/4dcxRP8lY7mnDLPC882m1Cl37lYefiUM/VHHJmHLRWyEH6GhAmeqPMRzoyFasAKtL +/MwE24J5OGRVueRCkKqKSEEdJ+bJYi2i81AR/AI8NlwgnHEaK56rVDhoZ9Dn/4h3vKV O4XwO8f+/P9qLMNoBqHCE/1/oOjDPRW8+qOSZN4/gmpT2za3GrhevT0qEcY1lZAvM3dc mW8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Ln/GNcNq5Ro2OkNEh/LM02ElmNPWJ/3MY9XfiUntdlc=; b=d5mcsOuT52HNqBkUjODNymKVR2GwcbXDMbxSN2i+UvZh92UIyVFg32lmhKJwmP5uU9 gdnoaAjdnvU7CDycFLytMlCdoeXtsKB7UAhoJs2Mx/Dr09kR37eg6u0BWTGj07bBEzvQ L070TxXDDOTgTZ9pPSO2phrRv7KPCIoSqkOiv0o0eXjYkKSzZ7G275Lbx4Twze3tfeV8 m0PRcpX1ZMKE8MqRO0fmVWaMKsadqXcDNIcQL9/0lLKq2sVhB9AErla0L+q5PXMFNCp3 KLl+7ilN/XymIlmEQZyYLcFIpbDx8+dhKykmIudz/lidGv5PBtXABWtZuthXHZM8RsGe Hf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C6COQJUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cr15si3290880ejc.676.2021.05.20.05.10.30; Thu, 20 May 2021 05:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C6COQJUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240837AbhETMKF (ORCPT + 99 others); Thu, 20 May 2021 08:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239809AbhETMJ4 (ORCPT ); Thu, 20 May 2021 08:09:56 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89BB0C01CEBA; Thu, 20 May 2021 03:44:23 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d16so12036244pfn.12; Thu, 20 May 2021 03:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ln/GNcNq5Ro2OkNEh/LM02ElmNPWJ/3MY9XfiUntdlc=; b=C6COQJUoHVx1FUvpa/Y1+fgwUD5eOuVSngTVZKQOjmbeC5IMKGBGpirqwdq+yh6upP AAaOuC+kLKQtVyi05CWflFO1z5s11+7IHT3F0e0/Vo0zvqZDWUcE7XoXicuK9f+kQXI5 opcyMD5UHfWrvGvjmkB6YUwXTFX5sNPzXPQil7/dwuPVpnLbdAMMDaTw7Z8VdnTP3cnr gPvwGl7MmoMV61feZJCu26gtXthY5ipd/i0Tl3FEle/ftQ+/Fhf5SsUBLwdZTWj+SfDS NcK0JqDQfoe+MGWgaYnFTpZLh2TY87+u5TXIm5qcqaBU76RLN4Pw9IsQd2P7NRzjfZdD NReQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ln/GNcNq5Ro2OkNEh/LM02ElmNPWJ/3MY9XfiUntdlc=; b=t+8fwuE2JOOzIy12DLAYid1D+3vC34CtOQBI2JDrRr5EKiyKPBltwK9cABGZuZF8HS tDNmb7Hl6aBxOxaNEtnD05ppPYhZ0EvuRA+SZWiobTDzDggDuX/wilBM2YH3FLVn8qz5 7pKjAbjYKP5gP2uLeKdWNKemzEUrtrgM05I1OXn1rPqNla9xUjUgDk5NPCacu6qHRPz5 RXIxEuXAB5OM79p24c7wbl45PxnO3g1N/mPTv95sI7Ka+dJo4Ph73HJdk9wMJWy3aqoJ oC2iHbip/dJIXhhIj4/03r4CZg8zcE3kfkSgL/uR0g6mYtEDB/pVw+GpEVXy1aLezXKV qSrw== X-Gm-Message-State: AOAM530NB2+a+oL6rG1YpNvdi9VHZ9P7FAlpIG/4Vcc336gtKrn12tyc 7sdYoBgmE2PJ4HfNjuRESeM= X-Received: by 2002:a62:2901:0:b029:28e:ef3d:10d2 with SMTP id p1-20020a6229010000b029028eef3d10d2mr3823125pfp.45.1621507463048; Thu, 20 May 2021 03:44:23 -0700 (PDT) Received: from pride.localdomain (c-174-61-140-56.hsd1.wa.comcast.net. [174.61.140.56]) by smtp.gmail.com with ESMTPSA id z12sm1762572pfk.45.2021.05.20.03.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 03:44:22 -0700 (PDT) From: Joe Richey To: trivial@kernel.org Cc: 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: [PATCH 0/6] Don't use BIT() macro in UAPI headers Date: Thu, 20 May 2021 03:43:37 -0700 Message-Id: <20210520104343.317119-1-joerichey94@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. Joe Richey (6): x86/elf: Don't use BIT() macro in UAPI headers KVM: X86: Don't use BIT() macro in UAPI headers drivers: firmware: psci: Don't use BIT() macro in UAPI headers uacce: Don't use BIT() macro in UAPI headers media: vicodec: Don't use BIT() macro in UAPI headers tools headers UAPI: Sync pkt_sched.h with the kernel sources arch/x86/include/uapi/asm/hwcap2.h | 2 +- include/uapi/linux/kvm.h | 4 +- include/uapi/linux/psci.h | 2 +- include/uapi/linux/v4l2-controls.h | 22 ++--- include/uapi/misc/uacce/uacce.h | 2 +- tools/include/uapi/linux/kvm.h | 4 +- tools/include/uapi/linux/pkt_sched.h | 122 ++++++++++++++++++++++++--- 7 files changed, 130 insertions(+), 28 deletions(-) -- 2.31.1