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=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 C89C9C433B4 for ; Fri, 21 May 2021 09:02:14 +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 4964B613AC for ; Fri, 21 May 2021 09:02:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4964B613AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y3P12nx3Q8cZ7npI3xoSvJJ5Ap4CWY4Gw+3RF8IHKok=; b=HlVHJlRoBF6dwFIFh1cxQ6L5un kEw6ujyzn/jRf2uoAlT4NzSTzcDy0+MDgut1pGaKjVAxMdCH/Em7Oju7RhgEBCTvxfB55Akx8AkUf 8xfXA95J9kOLvoyMgx4If47szGMUSfDVAsFSqk7aFjwmP/CKnxHWLo/4em1tg8faZ4NOPUPxss8BV W8mCO1w/JQLaoKPodb78IyTUF9jxtsFRYjfngMppqp8QVo1k3txCcMU+Kb1hiEOxZIE4nsHKj0cFw D7J7br4yPtczKlzJmbUpiC3EenHS+YlS42Y6XJwkeguxlsFToGL4tHJh/hjMxok1FoNnjkoWBpxNV CL5/o3lw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk10A-004Zmd-1M; Fri, 21 May 2021 08:59:26 +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 1lk103-004ZlP-Ko for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 08:59:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=3yVIvqG1JyVADZbEfVpibeclSnVPEq1FjsSnqb72wTc=; b=J+uWOo4JNLaYSEAdkNOpKjsybM huZAHdbY8ccZYTsd24eFbtWJcoebQ96MlYyLVwkxHeqJxKP6tr4Afy54XpI7q6rqUMyYKntBQKR2q Ugq20bJDda1VUggUZBz4+eCw1mAUo15NjsWfrQn+Sj856jO5lBSQpxt+XEKqRJphGgK2uQGEdq0xw PrGoXOE7/LQpEkScNbXZa3pzAB8BOOevX8OY06VfYpZX+7blND7wny6xFzYhRftHADtifQWOYuMFS qovq54feAm4XAuvSqVdJwy1Bh4QbbFGIcuST6OSO56Iezeah4NHJP+E4JoQG8MzD+7/bZRN/pbcua YNAPMnpA==; Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk100-00GxuF-SN for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 08:59:18 +0000 Received: by mail-pl1-x62e.google.com with SMTP id u7so2051179plq.4 for ; Fri, 21 May 2021 01:59:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=3yVIvqG1JyVADZbEfVpibeclSnVPEq1FjsSnqb72wTc=; b=caBpAi/U0Iw0NsZBGSpnZsUmuBjorpbNtdbB2BbnqIWsMc/AtMZOiQL7iWZ0JipP0a tiOHopCpQ5nlzMNHuTzbFrT2HmQpo6K6JCoV1/FBEWNVIrFDD1Z8ZQjVCtNt7xy8SYLN swknq+6kJOrd1jz6/AbBcSeFvsDPRTCMLvCeiCv1rVb2+lUOKt21TgUZVUNPKW9yK5xn xP5q1+DU2ksBhFts+K8XsQKCPgp3L+YybMQYyJE15ISaXSH2xgKYM5JSvjelfqztMwrc cQY97GJby/SdpBcPGfoSM0i8KUyFcAzND8MkcRU/BmYVLKnPybY1kDiQIpkShrac1nZm fYRQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=3yVIvqG1JyVADZbEfVpibeclSnVPEq1FjsSnqb72wTc=; b=XIparHF79ib2fYAsncknisshzrdaUOxMXoYXe7QijLePxpeINKudZ+8L2NAaFngWPw EHlHTktTleG0+savXF6arXoOztX6nw/Asa6t6DTh8c2N4lA3ZXbFq7vCyVKl7aIbD+lD IEY4NhftDlfZfuofX6AF/ABrY3YWfS/heFz8ysF9CPM00ymRf1hqtSB9LsylnZLmGmk4 DZlGwTGD/nsjCrdjgjcmzI/SszQhVozb3INqKVDOW6M5ZezbV/bKcg14baiOGmNkjx/G qunNqsGp6MfbGdexNBOCqCXNIcCtWCjzH+LdJKt4txW0Bx44xdEbb+2SGg95hYEQg9Hz AeSA== X-Gm-Message-State: AOAM530gK32o47k0PeS/dJmaY5CzGvptZw7vEVowFWgYqCZUzeJwQeYS hsVwnf16Z8IWyZvLosK8Dj4= X-Google-Smtp-Source: ABdhPJxPN1UZLO0PXhLTlf5qR//s8n68GRwyK+x/ityD7Qg25LhfVT+kgYl0HAV2wRFoergfO/9U1Q== X-Received: by 2002:a17:90a:5309:: with SMTP id x9mr20007pjh.111.1621587555532; Fri, 21 May 2021 01:59:15 -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 q3sm3914489pff.142.2021.05.21.01.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 01:59:15 -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 , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Andi Kleen , "Chang S. Bae" , Sasha Levin , Peter Xu , Lei Cao , Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , Kenneth Lee , Greg Kroah-Hartman , Jean-Philippe Brucker , Jonathan Cameron , Hans Verkuil , 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 v2 0/7] Don't use BIT() macro in UAPI headers Date: Fri, 21 May 2021 01:58:41 -0700 Message-Id: <20210521085849.37676-1-joerichey94@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520104343.317119-1-joerichey94@gmail.com> References: <20210520104343.317119-1-joerichey94@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_015916_942102_881D6510 X-CRM114-Status: GOOD ( 16.57 ) 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 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, they should instead use the _BITUL(n) macro. This patch chages all existing usages in UAPI headers and updates ./scripts/checkpatch.pl to properly reccomend the correct macro depending on context. Running the below commands shows no more incorrect macro usages: rg "BIT\(" **/uapi/** rg "BIT_ULL\(" **/uapi/** Tested by building a basic kernel. Changes are trivial. I encountered this issue when compiling the following program: #include #include // Detect if FSGSBASE instructions are enabled int main() { unsigned long val = getauxval(AT_HWCAP2); return !(val & HWCAP2_FSGSBASE); } Resulting in the following likner error: /usr/bin/ld: /tmp/cceFpAdR.o: in function `main': gs.c:(.text+0x21): undefined reference to `BIT' Changes from V1 to V2: - Use _BITUL() macro instead of open-coding - Fixup HWCAP2_RING3MWAIT as well - Shorten commits and added "Fixes" per reviewer comments - checkpatch: Broaden UAPI regex - checkpatch: Reccomend _BITULL()/_BITUL() for UAPI headers Joe Richey (7): x86/elf: Use _BITUL() macro in UAPI headers KVM: X86: Use _BITUL() macro in UAPI headers drivers: firmware: psci: Use _BITUL() macro in UAPI headers uacce: Use _BITUL() macro in UAPI headers media: vicodec: Use _BITUL() macro in UAPI headers tools headers UAPI: Sync pkt_sched.h with the kernel sources checkpatch: suggest _BITULL() and _BITUL() for UAPI headers arch/x86/include/uapi/asm/hwcap2.h | 6 +- include/uapi/linux/kvm.h | 5 +- include/uapi/linux/psci.h | 4 +- include/uapi/linux/v4l2-controls.h | 23 ++--- include/uapi/misc/uacce/uacce.h | 3 +- scripts/checkpatch.pl | 16 ++-- tools/include/uapi/linux/kvm.h | 5 +- tools/include/uapi/linux/pkt_sched.h | 122 ++++++++++++++++++++++++--- 8 files changed, 148 insertions(+), 36 deletions(-) -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel