From patchwork Thu May 20 10:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 443659 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 F25E5C433ED for ; Thu, 20 May 2021 12:09:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D352060FDA for ; Thu, 20 May 2021 12:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241578AbhETMKY (ORCPT ); Thu, 20 May 2021 08:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237120AbhETMKD (ORCPT ); Thu, 20 May 2021 08:10:03 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95FEC00F789; Thu, 20 May 2021 03:44:41 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id o17-20020a17090a9f91b029015cef5b3c50so5205219pjp.4; Thu, 20 May 2021 03:44:41 -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=LRY+3cJVXzz2zcOenbypgu3Wy1PZW3y4sq5PxyFROR0=; b=sx5X8GbCdxGlmtdtk6i28Qbu++UYP1OyWcUVsh1Z4P2G8nPl/BajRPrYBl6LYmbn/G 2d51AT2Mkf9nIaR87KlwB4g1DWNVA37B2MNmKD43CxxIjFoo9ugktQpMVZgace5+9D0s WasPefkQS8WqT2cKX3WTUgcpyDpzg5gVn7sS1B0J+0L0IlNzcDR+yHOEp/aeBGGx+7mx 4yWxEPkJEvuuhN7HL0nlV0qd8xbBe+W00H97ivLM/SMsYTumY+cZFpHJHDL5uKZFu6AR zMLL2DTaFPST0lbLuyZXLVumbFybcj04+sCGEP+2INQ8g5EI/KUettMabLV6qWKuHHuX etIA== 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=LRY+3cJVXzz2zcOenbypgu3Wy1PZW3y4sq5PxyFROR0=; b=SDu9KhNz1JA/99UqbtnmFjXYSeUyi4wbypBaN/dcxlLV2vapd4gjwDxeD2/F7xCz3e CMaCs3NUdCWP3WL4qY9ucLkc+5kq73mD3gRen6q3YGoUVMXqDXadOqLJ7lAHKeWcbs1+ gbMSTLcTOMYBxEFHBQfF77+nqyHM5brDXOY4SzfQGPVS9SQGskmDYBN5rQFp9z4ZV8vF JQeTzr+3QBXN2UQZ6SJSxqngg230Z1JdAgdgkTFb31x12uyVX1b/Ma4wYtMCpCtp1o+U gwt0fGU229krkRBQZDp5y1z0zv27GSmWmeyFozJx4LIZ5cAi6406Xy+sRuDWlwSdgqMO aHEg== X-Gm-Message-State: AOAM531nI+EufRPBSdnSUttd3ahnIIj51RjJea5zViHufPZDkxCfnURS y/fZbd61vDv2DmC4nFj3ia8= X-Google-Smtp-Source: ABdhPJxlZ+1aFVq5YW6UEzC3HQLJbeJXnzNN90quf3pOC74eAip1OmzI0t0O+OqTO1/BdCxiiJM9pA== X-Received: by 2002:a17:902:c409:b029:f0:d31d:4877 with SMTP id k9-20020a170902c409b02900f0d31d4877mr5064760plk.74.1621507481485; Thu, 20 May 2021 03:44:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 03:44:41 -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 1/6] x86/elf: Don't use BIT() macro in UAPI headers Date: Thu, 20 May 2021 03:43:38 -0700 Message-Id: <20210520104343.317119-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey A previous patch [1] used the BIT() macro to define HWCAP2_FSGSBASE. This macro is defined in the kernel but not in the UAPI headers. [1] https://lore.kernel.org/patchwork/patch/912068/ Signed-off-by: Joe Richey --- arch/x86/include/uapi/asm/hwcap2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/uapi/asm/hwcap2.h b/arch/x86/include/uapi/asm/hwcap2.h index 5fdfcb47000f..6d2175b43710 100644 --- a/arch/x86/include/uapi/asm/hwcap2.h +++ b/arch/x86/include/uapi/asm/hwcap2.h @@ -6,6 +6,6 @@ #define HWCAP2_RING3MWAIT (1 << 0) /* Kernel allows FSGSBASE instructions available in Ring 3 */ -#define HWCAP2_FSGSBASE BIT(1) +#define HWCAP2_FSGSBASE (1 << 1) #endif From patchwork Thu May 20 10:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 443660 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 53059C433B4 for ; Thu, 20 May 2021 12:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 358D36105A for ; Thu, 20 May 2021 12:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241181AbhETMKQ (ORCPT ); Thu, 20 May 2021 08:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234850AbhETMKC (ORCPT ); Thu, 20 May 2021 08:10:02 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F13C00F78A; Thu, 20 May 2021 03:44:43 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id q6so8916895pjj.2; Thu, 20 May 2021 03:44:43 -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=RFZzbSCSG3liEBFzsFBndnKLD/Fxvy9/A4lnI3gqTkk=; b=JIRPPqQQnCwSCGUt//YCjOWHq2ypvad/gMkV8o3aD7q2iXNGsOkmPuyuSearwgsQZF dBrrjWfXFgsidXWuwCdUHWdEjruWKbKlRC883fPbdU3s/ElPPKF3ZXZ/gWHCqTpIEZvh D+uTuT7SiiMX8uqyVF6zFDrCeScNYWjtipxI9AvISF9jEU+FC+bja7YGzlh0zshKSB9w uqaLECyB3jTOI6BpGLpdaYdQ/kmEOJd+E1Y05e4fQpsdyBlY2V3a8pta9xzuGIU42sn4 6lLd/A7a6q1oaC1xHBsBMNq14JwG5y8FApd0SEjIcybEYr0aJgPfW7rQQG37AU7e0WSQ DHrA== 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=RFZzbSCSG3liEBFzsFBndnKLD/Fxvy9/A4lnI3gqTkk=; b=PKS++gee56PAZd04TIFX4K+nHNcG0s3gUnuobeScL3E4IxBSfGOFIjGfXjmNoIIAv2 QT94ElMqPgjj88B9rTzd1v1IfGMxXHCGAB1L0uJm2DoKTwnK809tRQLIZkeG3feAcRH7 HKoLivjGKseXfd8kb/jyjR7VlPBAZIY3IShdeRr25HCV35qhPLBZI94+hxRip9OruJH3 DwEbIcuyVdT4MNa5pEk9QQ+yHag/V6XOO//SQ9RmOI8OUbAIESROjGmsSdxJI2cBlWO/ 9gkIDDxjcuqyN5Ix3J1LV2+mRafW3bp9Dor2P6Tahow2VaySrq3k4d6G7eAxaryUZ4zf icAg== X-Gm-Message-State: AOAM530iqjfYf86uWkkQ7BZqFo/CvKXeCNji8vgBzS5tyRauld6rQCXR MrckDt2NZqOC9kcFnOrAXhA= X-Google-Smtp-Source: ABdhPJxx1dTd0Y3Xng3m8t0IBTSlLbvNI9PVElP0v8+VI4s1saDnixJ2q3TyYoXNuylaWlJKnSm3bw== X-Received: by 2002:a17:902:8ecc:b029:ef:6471:dc08 with SMTP id x12-20020a1709028eccb02900ef6471dc08mr5094131plo.5.1621507482766; Thu, 20 May 2021 03:44:42 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 03:44:42 -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 2/6] KVM: X86: Don't use BIT() macro in UAPI headers Date: Thu, 20 May 2021 03:43:39 -0700 Message-Id: <20210520104343.317119-3-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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey A previous patch [1] used the BIT() macro to define the KVM_DIRTY_GFN_F_* constants in KVM's UAPI header. This macro is defined in the kernel but not in the UAPI headers. [1] https://patchwork.kernel.org/patch/11854393 Signed-off-by: Joe Richey --- include/uapi/linux/kvm.h | 4 ++-- tools/include/uapi/linux/kvm.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 3fd9a7e9d90c..8f8a0fd7cd65 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1879,8 +1879,8 @@ struct kvm_hyperv_eventfd { * conversion after harvesting an entry. Also, it must not skip any * dirty bits, so that dirty bits are always harvested in sequence. */ -#define KVM_DIRTY_GFN_F_DIRTY BIT(0) -#define KVM_DIRTY_GFN_F_RESET BIT(1) +#define KVM_DIRTY_GFN_F_DIRTY (1 << 0) +#define KVM_DIRTY_GFN_F_RESET (1 << 1) #define KVM_DIRTY_GFN_F_MASK 0x3 /* diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h index 3fd9a7e9d90c..8f8a0fd7cd65 100644 --- a/tools/include/uapi/linux/kvm.h +++ b/tools/include/uapi/linux/kvm.h @@ -1879,8 +1879,8 @@ struct kvm_hyperv_eventfd { * conversion after harvesting an entry. Also, it must not skip any * dirty bits, so that dirty bits are always harvested in sequence. */ -#define KVM_DIRTY_GFN_F_DIRTY BIT(0) -#define KVM_DIRTY_GFN_F_RESET BIT(1) +#define KVM_DIRTY_GFN_F_DIRTY (1 << 0) +#define KVM_DIRTY_GFN_F_RESET (1 << 1) #define KVM_DIRTY_GFN_F_MASK 0x3 /* From patchwork Fri May 21 08:58:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 444959 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 0B18AC433ED for ; Fri, 21 May 2021 08:59:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF006613BD for ; Fri, 21 May 2021 08:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234581AbhEUJAs (ORCPT ); Fri, 21 May 2021 05:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234426AbhEUJAp (ORCPT ); Fri, 21 May 2021 05:00:45 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 584BEC061574; Fri, 21 May 2021 01:59:21 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id h20-20020a17090aa894b029015db8f3969eso6191669pjq.3; Fri, 21 May 2021 01:59:21 -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=TzzZMridd67ro07tLm+JuMQ0CAOlJ9SkHJCUAihqZXk=; b=BQlYs7dJVPHEjXrQrmBRQDrbMT7YXWnYIyhEoL3fKfToRSckEDyxlBkrWW/3CIeXzx vmPSrNZTlIcj/xeMDzFKXSX26W04T8pG+6dwMVBaIKr1ojfSdLLAE/eNXF6a27z7/y89 OXyF29p2YaKaKlDvIHgkPGFyJ2S/wUBbiEihnXStbTl2LQokBCY30T8qEQbB+Zl2zgdy QOSFfR4JYaighKeG8eIg5PMkacXypBPKR/DTgjHTiu19UiU+8VW/KKezuBLL7lhJyo2m v8tzNwwi34HWndUT2UAs4z7neQIbocXA5GOnHP4BzMo1tWEPjSLG9euTLU2rYWIRcPtR VGIA== 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=TzzZMridd67ro07tLm+JuMQ0CAOlJ9SkHJCUAihqZXk=; b=P6Jxm6chK/KYobna1AJ3kYKo0Zmk+9vxPKoVsXEdQCyei5qmDjyDOtlF7E/kiu4lBu afebrZ11PYpCd1wi8vhs35KPtgLR+B8ant+HfROALXyYSDBKPDvYMRMXnpZqKE6zKpsW OW0XMSxMOGIfNTOckH8dJHxNQHnfIqW1ojdJGtqvag0llPz0RYFvs0Mn1dRYkqrsXqDX V2p7dsB/9MNIJIt4V+AM/RvnNAc4gcsay7USMk2PjuHXz4C1HGOCMnxlP/GaJFCW2aST vVePbsqGyzdEO8q1t/U3He9wRiDtR8rvHDJUfMiWdAm9zzow2a4p5BrcBGDaY6PxDvrz qmzg== X-Gm-Message-State: AOAM5314wdQXAfn597o/XG4pfD25ACEsaev55xfIsJCxbkPahEv8trpN DJgN8a1LIZNPoRFpTmPcqPY= X-Google-Smtp-Source: ABdhPJwvn9TrOUeraeP5t4DRzPjg9f8T739lppJpjyuTjmkW891QfcTscFYafTp8kQpW4q3+/BXyFA== X-Received: by 2002:a17:90a:8d82:: with SMTP id d2mr9757052pjo.200.1621587560969; Fri, 21 May 2021 01:59:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 01:59:20 -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 , Sasha Levin , "Chang S. Bae" , Andi Kleen , Lei Cao , Peter Xu , Daniel Lezcano , Ulf Hansson , "Rafael J. Wysocki" , Jean-Philippe Brucker , Zaibo Xu , Kenneth Lee , Greg Kroah-Hartman , 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 3/7] drivers: firmware: psci: Use _BITUL() macro in UAPI headers Date: Fri, 21 May 2021 01:58:44 -0700 Message-Id: <20210521085849.37676-4-joerichey94@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210521085849.37676-1-joerichey94@gmail.com> References: <20210520104343.317119-1-joerichey94@gmail.com> <20210521085849.37676-1-joerichey94@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey Replace BIT() in psci's UPAI header with _BITUL(). BIT() is not defined in the UAPI headers and its usage may cause userspace build errors. Fixes: 60dd1ead65e8 ("drivers: firmware: psci: Announce support for OS initiated suspend mode") Signed-off-by: Joe Richey Acked-by: Mark Rutland --- include/uapi/linux/psci.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/psci.h b/include/uapi/linux/psci.h index 2fcad1dd0b0e..87afdeb95096 100644 --- a/include/uapi/linux/psci.h +++ b/include/uapi/linux/psci.h @@ -12,6 +12,8 @@ #ifndef _UAPI_LINUX_PSCI_H #define _UAPI_LINUX_PSCI_H +#include + /* * PSCI v0.1 interface * @@ -100,7 +102,7 @@ #define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK \ (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT) -#define PSCI_1_0_OS_INITIATED BIT(0) +#define PSCI_1_0_OS_INITIATED _BITUL(0) #define PSCI_1_0_SUSPEND_MODE_PC 0 #define PSCI_1_0_SUSPEND_MODE_OSI 1 From patchwork Thu May 20 10:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 443658 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 13843C433B4 for ; Thu, 20 May 2021 12:09:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEC2C6105A for ; Thu, 20 May 2021 12:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237316AbhETMK3 (ORCPT ); Thu, 20 May 2021 08:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237335AbhETMKE (ORCPT ); Thu, 20 May 2021 08:10:04 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3573C00F78E; Thu, 20 May 2021 03:44:45 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id c12so462511pfl.3; Thu, 20 May 2021 03:44:45 -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=7ZiFgLWMWvuZRELwo2jd+K7U5Q4HIOe8SBImsjcWPpg=; b=PEGXZmX1QZg5eZN102ymP6m47ZpJDcsahQdFjSm6a/+FEr02vOmCcLQWSAm6hZxP3r JO5wS7RX1ObsIwWuIKV7DYdVNiWMTqv7+/wwIFqBwsW505FTcwRiiOuiFJOeI/ILVjFz GoAQUrP7+2JWnX7Zt/+Cnqhkib1bkAJcHlgKmG6ozF8voutTIl2ZURlzfRvhIn2iCA/J HOtK7rSzHTX7ZuT7ynRcid8yAogEpyjHZic8qeQlDQ1Y3jRgOkosl8jAT/T/ro8FYExl QJPx1DAMTmEVxbu3/CnafFrVTODY8Q15UDAstGwLkfNLOrtbge2+C8zytnVgU2zSVJSt Btjg== 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=7ZiFgLWMWvuZRELwo2jd+K7U5Q4HIOe8SBImsjcWPpg=; b=CMTqDYDYg1b6tjffK8ckFAOf02owkiV+APFNkguhJUeMDiqBuvSnd52990I0/T5YQn 251ihEyZGiNT4y52iu0TUmqG2AD/ot4YqQTysjdBkacxWO+9CJ3ch8hT5OIF91WvnrwR wKTXcY1cU74UlpSbJlatLBUMPIWjAan68vZ/c2AuFCDIAvH7Ss88bQY84Bu5g6UCGJ5m 12HrohKX8gg1npNwiR7ODY5iOBF3iVda9dZwSmY6QCLo5KWoEtUFk9IP6Nmptgvg4k4W LvAL9oySYVWUknGDh8J+fbHjj8SbOq5362MnTZVN7eINCLGW9+OG6UMkIiTJhQG6SDgj NT4A== X-Gm-Message-State: AOAM533gJBsER3+SWE/1Pb8myDx/C+au7TpUEsxP/RdmKaN1ONzAftb0 LBTgA3Jupo7YXn1fKtqthQA= X-Google-Smtp-Source: ABdhPJxoh1IwwPMV1InzW2164Znzz0uMx6+mRF33S95Wu+6uvNRGeG1KcrO6dglWETXatjWGjDn2fA== X-Received: by 2002:a62:f24b:0:b029:2dc:9098:c14c with SMTP id y11-20020a62f24b0000b02902dc9098c14cmr3833071pfl.19.1621507485397; Thu, 20 May 2021 03:44:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 03:44:45 -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 4/6] uacce: Don't use BIT() macro in UAPI headers Date: Thu, 20 May 2021 03:43:41 -0700 Message-Id: <20210520104343.317119-5-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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey A previous patch [1] used the BIT() macro to define UACCE_DEV_SVA. This macro is defined in the kernel but not in the UAPI headers. [1] https://lore.kernel.org/patchwork/patch/11334877/ Signed-off-by: Joe Richey --- include/uapi/misc/uacce/uacce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/misc/uacce/uacce.h b/include/uapi/misc/uacce/uacce.h index cc7185678f47..a404ec40e000 100644 --- a/include/uapi/misc/uacce/uacce.h +++ b/include/uapi/misc/uacce/uacce.h @@ -23,7 +23,7 @@ * Support PASID * Support device page faults (PCI PRI or SMMU Stall) */ -#define UACCE_DEV_SVA BIT(0) +#define UACCE_DEV_SVA (1 << 0) /** * enum uacce_qfrt: queue file region type From patchwork Fri May 21 08:58:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 444958 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 BB19CC43460 for ; Fri, 21 May 2021 08:59:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E92B613AC for ; Fri, 21 May 2021 08:59:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234808AbhEUJAw (ORCPT ); Fri, 21 May 2021 05:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234612AbhEUJAt (ORCPT ); Fri, 21 May 2021 05:00:49 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF85C06138A; Fri, 21 May 2021 01:59:25 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id v14so10996143pgi.6; Fri, 21 May 2021 01:59:25 -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=GRgnjjTyc74OV+vFDIKTcD4cnOw31v5F87VYgn4dO00=; b=JFKQpqxj0ygKabhGTJJ+/xkGGepO/JNO2FMbi0BuqBuK0zIwrUvOUQfkljjTPSpSKW wB9aBkinNrys/SDoxg7RXc8aJBj5Mwp2cA6MVV+u7sSRFfaSYC1LMWKvfgyuFUTt9tEk X7orRttCgEikL7CCIYE78Z4ucQGX7v3FfRR0gQJFFn5GkC2RI9bvWMgALeGyssHK1CbM XDKQmzMS0Pqs4DgMm76QN6Y4mujKdjn5agq5aMlbEdWTFj4MYfc7OVQ+awIAw8hRIalj ZvKkLhFstreG7MxyRt3rfBSvtSfMGYO6Bk6fOCuCgWwWdFeoDMyyByeESrKDrz/fEBI2 q64g== 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=GRgnjjTyc74OV+vFDIKTcD4cnOw31v5F87VYgn4dO00=; b=ufpD4rSLqTipW736xd2/4Jt1JtyN7Fu/PY+JYcweOoXyR6ZE8LbV/nluixhjakSkqw d7dd99u2xmA9YXOB209Pdevqpl0N925IqzvPt8JZ5jVBHP4p4rEOBN7+CRvt3r0ZPuM2 b1YaHPFLyFRbrf1u/qHp5HhwKJV2EvLL2nkb79BIqHBe+2yGdc/Lla8MpQj8RIzocqjx M+MTNUox7QSdz8VA0aRsUncovlH0BqUAvMd9sffZ5LXs5fHMOG7ZlnKYkhjVUPSquUUD VX3JF/gzRsWxbm/2rgnPsoji8bM9wBXyEXDFI/hpiD059CAICH1TeNBXTiRGbQMuifdr OVag== X-Gm-Message-State: AOAM530zjIN25pI99sgS3OJBz3N9icldwBNBzlrY6s9asDbHLyaDlXV8 hufdz4ZoYX0BaeCz3NuTHIY= X-Google-Smtp-Source: ABdhPJx2PTi/wpWd6gak1llMG8fVDiGbU+juhvNqBuEyttwwviuaokLn9lG3Ej6ao2/rDQ055IDIVA== X-Received: by 2002:a05:6a00:14d0:b029:2cf:ee47:dfd9 with SMTP id w16-20020a056a0014d0b02902cfee47dfd9mr9557263pfu.31.1621587564803; Fri, 21 May 2021 01:59:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 01:59:24 -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 , "Chang S. Bae" , Andi Kleen , Sasha Levin , Peter Xu , Lei Cao , Ulf Hansson , Daniel Lezcano , "Rafael J. Wysocki" , Kenneth Lee , Jonathan Cameron , Zaibo Xu , Greg Kroah-Hartman , 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 5/7] media: vicodec: Use _BITUL() macro in UAPI headers Date: Fri, 21 May 2021 01:58:46 -0700 Message-Id: <20210521085849.37676-6-joerichey94@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210521085849.37676-1-joerichey94@gmail.com> References: <20210520104343.317119-1-joerichey94@gmail.com> <20210521085849.37676-1-joerichey94@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey Replace BIT() in v4l2's UPAI header with _BITUL(). BIT() is not defined in the UAPI headers and its usage may cause userspace build errors. Fixes: 206bc0f6fb94 ("media: vicodec: mark the stateless FWHT API as stable") Signed-off-by: Joe Richey --- include/uapi/linux/v4l2-controls.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index d43bec5f1afd..5afc19c68704 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -50,6 +50,7 @@ #ifndef __LINUX_V4L2_CONTROLS_H #define __LINUX_V4L2_CONTROLS_H +#include #include /* Control classes */ @@ -1602,30 +1603,30 @@ struct v4l2_ctrl_h264_decode_params { #define V4L2_FWHT_VERSION 3 /* Set if this is an interlaced format */ -#define V4L2_FWHT_FL_IS_INTERLACED BIT(0) +#define V4L2_FWHT_FL_IS_INTERLACED _BITUL(0) /* Set if this is a bottom-first (NTSC) interlaced format */ -#define V4L2_FWHT_FL_IS_BOTTOM_FIRST BIT(1) +#define V4L2_FWHT_FL_IS_BOTTOM_FIRST _BITUL(1) /* Set if each 'frame' contains just one field */ -#define V4L2_FWHT_FL_IS_ALTERNATE BIT(2) +#define V4L2_FWHT_FL_IS_ALTERNATE _BITUL(2) /* * If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this * 'frame' is the bottom field, else it is the top field. */ -#define V4L2_FWHT_FL_IS_BOTTOM_FIELD BIT(3) +#define V4L2_FWHT_FL_IS_BOTTOM_FIELD _BITUL(3) /* Set if the Y' plane is uncompressed */ -#define V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED BIT(4) +#define V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED _BITUL(4) /* Set if the Cb plane is uncompressed */ -#define V4L2_FWHT_FL_CB_IS_UNCOMPRESSED BIT(5) +#define V4L2_FWHT_FL_CB_IS_UNCOMPRESSED _BITUL(5) /* Set if the Cr plane is uncompressed */ -#define V4L2_FWHT_FL_CR_IS_UNCOMPRESSED BIT(6) +#define V4L2_FWHT_FL_CR_IS_UNCOMPRESSED _BITUL(6) /* Set if the chroma plane is full height, if cleared it is half height */ -#define V4L2_FWHT_FL_CHROMA_FULL_HEIGHT BIT(7) +#define V4L2_FWHT_FL_CHROMA_FULL_HEIGHT _BITUL(7) /* Set if the chroma plane is full width, if cleared it is half width */ -#define V4L2_FWHT_FL_CHROMA_FULL_WIDTH BIT(8) +#define V4L2_FWHT_FL_CHROMA_FULL_WIDTH _BITUL(8) /* Set if the alpha plane is uncompressed */ -#define V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED BIT(9) +#define V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED _BITUL(9) /* Set if this is an I Frame */ -#define V4L2_FWHT_FL_I_FRAME BIT(10) +#define V4L2_FWHT_FL_I_FRAME _BITUL(10) /* A 4-values flag - the number of components - 1 */ #define V4L2_FWHT_FL_COMPONENTS_NUM_MSK GENMASK(18, 16) From patchwork Fri May 21 08:58:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Richey X-Patchwork-Id: 444957 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 8E785C43460 for ; Fri, 21 May 2021 08:59:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74E8361363 for ; Fri, 21 May 2021 08:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235454AbhEUJBC (ORCPT ); Fri, 21 May 2021 05:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234881AbhEUJAx (ORCPT ); Fri, 21 May 2021 05:00:53 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB99DC06138A; Fri, 21 May 2021 01:59:28 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id f22so12777663pgb.9; Fri, 21 May 2021 01:59:28 -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=9VVK8/1KColE59Xv+mm8AL8uAr/GCHzBnr8zfukNEnQ=; b=tzlpR0iZmoOnnL3HUU+5tU3XVVpaO9lr4EYeRCULCPKhd9atNaueRaBVMauwxoFL3V guhGiDAcC93SbpTyCmq3CAMSpk1TCWpnoU/dPnHUUrydMd0M7RMjARdrZtNa3NGiez8q AVq8u7a+Mnsa364kIM7Y7P0cyYqGmtBaXnQms7iTyb18Cg9IOhp5ynXqI/WzUs00R/pL eXqqNda9L1/0HUusHsWegsA6GENsNCUYPjTnA0AQaUX/lbrodTJ+2z3QxNIbaoDmjVz8 JTlBX7e79sqyjxLNYmhwUNNBfoFU8FspEUnIP2s+8LP35yVAzTjhn/0LW4lS/o1SQuc/ WTcA== 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=9VVK8/1KColE59Xv+mm8AL8uAr/GCHzBnr8zfukNEnQ=; b=LcoyEX8c//Elo2IUTAO6uVy2i5zj3DbLGCxoG9XFKyF34XCN5ITAPGm6aID9zvVzsT VwcJ6RKzPj+5PMO0mhfwawpxa+3mosTXJ9dqLrGPrel64lEhaty2NotLawGCRQfsN7am zjIetnKM5kc3bgehKkv8/B2J+jn6uNweUbeQPlKjj0y20C5/KWZ6TjIxzLpgeg9YBVTr Dgh8lz2OFccEsRFeRMC8Q0SOjcd3BGbuljRGVy1TGEoqPjkld7OzsNbLgscWeK5dhn2/ 5W7OW4fLjxNqZ7V89NpLrn0DCghBm9nMLpSjqbfQZWhLbaI1sBZmt3fkSE4lMDC9M9d2 P0Yg== X-Gm-Message-State: AOAM532gMqAzm8bkXRDeAbS8h/bps7p0vEcr0pTj/oIMvxrPfRk+g3y2 EGl2jhyMPYT3XvwxTBIy4+s= X-Google-Smtp-Source: ABdhPJyc9Jyz5l4cpY6SfZOEGuvmlCLat0me4TBWH+8q7gJMiyUN/NrNb6qzjrqqQCVYZ1W+qfk04g== X-Received: by 2002:a62:e21a:0:b029:2de:4440:3a with SMTP id a26-20020a62e21a0000b02902de4440003amr9052894pfi.23.1621587568515; Fri, 21 May 2021 01:59:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 01:59:28 -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 , Sasha Levin , "Chang S. Bae" , Andi Kleen , Peter Xu , Lei Cao , Ulf Hansson , Daniel Lezcano , "Rafael J. Wysocki" , Jean-Philippe Brucker , Zaibo Xu , Greg Kroah-Hartman , 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 7/7] checkpatch: suggest _BITULL() and _BITUL() for UAPI headers Date: Fri, 21 May 2021 01:58:48 -0700 Message-Id: <20210521085849.37676-8-joerichey94@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210521085849.37676-1-joerichey94@gmail.com> References: <20210520104343.317119-1-joerichey94@gmail.com> <20210521085849.37676-1-joerichey94@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Joe Richey Instead of just ignoring UAPI headers, reccomend the UAPI compatible macros if a user adds something that looks like (1 << n). Normal kernel code will continue to get BIT_ULL() and BIT() reccomended. This change also modifies the $realfile regex to match headers that have "include/uapi" anywhere in their path so paths like: tools/include/uapi/linux/kvm.h arch/x86/include/uapi/asm/hwcap2.h get recognized as UAPI headers. Signed-off-by: Joe Richey --- scripts/checkpatch.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d65334588eb4..47edc61b74c2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -7020,15 +7020,17 @@ sub process { } } -# check for #defines like: 1 << that could be BIT(digit), it is not exported to uapi - if ($realfile !~ m@^include/uapi/@ && - $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) { - my $ull = ""; - $ull = "_ULL" if (defined($1) && $1 =~ /ll/i); +# check for #defines like: 1 << that could be BIT(digit) or similar + if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) { + my $ull = (defined($1) && $1 =~ /ll/i); + my $macroname = $ull ? "BIT_ULL" : "BIT"; + if ($realfile =~ m@include/uapi/@) { + $macroname = $ull ? "_BITULL" : "_BITUL"; + } if (CHK("BIT_MACRO", - "Prefer using the BIT$ull macro\n" . $herecurr) && + "Prefer using the $macroname macro\n" . $herecurr) && $fix) { - $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/; + $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/${macroname}($1)/; } }