From patchwork Wed Jul 12 10:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simone Ballarin X-Patchwork-Id: 13310043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66BEAC001B0 for ; Wed, 12 Jul 2023 10:34:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.562201.878791 (Exim 4.92) (envelope-from ) id 1qJXAM-00066u-85; Wed, 12 Jul 2023 10:33:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 562201.878791; Wed, 12 Jul 2023 10:33:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qJXAM-00065M-2Q; Wed, 12 Jul 2023 10:33:50 +0000 Received: by outflank-mailman (input) for mailman id 562201; Wed, 12 Jul 2023 10:33:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qJXAK-00061z-Tc for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:48 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9556afb5-209f-11ee-8611-37d641c3527e; Wed, 12 Jul 2023 12:33:47 +0200 (CEST) Received: from beta.bugseng.com (unknown [37.161.151.90]) by support.bugseng.com (Postfix) with ESMTPSA id 15B614EE0C87; Wed, 12 Jul 2023 12:33:46 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9556afb5-209f-11ee-8611-37d641c3527e From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , Stefano Stabellini , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder , Simone Ballarin Subject: [XEN PATCH v3 01/15] x86/cpufreq: fix violations of MISRA C:2012 Rule 7.2 Date: Wed, 12 Jul 2023 12:32:02 +0200 Message-Id: <4f22e7c9de1ca407d976891774ad7c74df6cb36f.1689152719.git.gianluca.luparini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type and also to other literals used in the same contexts or near violations, when their positive nature is immediately clear. The latter changes are done for the sake of uniformity. Signed-off-by: Gianluca Luparini Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v3: - change 'Signed-off-by' ordering Changes in v2: - change commit title to make it unique - change commit message --- xen/arch/x86/acpi/cpufreq/powernow.c | 14 +++++++------- xen/include/acpi/cpufreq/processor_perf.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c index d4c7dcd5d9..8e0784b69c 100644 --- a/xen/arch/x86/acpi/cpufreq/powernow.c +++ b/xen/arch/x86/acpi/cpufreq/powernow.c @@ -32,14 +32,14 @@ #include #include -#define HW_PSTATE_MASK 0x00000007 -#define HW_PSTATE_VALID_MASK 0x80000000 -#define HW_PSTATE_MAX_MASK 0x000000f0 +#define HW_PSTATE_MASK 0x00000007U +#define HW_PSTATE_VALID_MASK 0x80000000U +#define HW_PSTATE_MAX_MASK 0x000000f0U #define HW_PSTATE_MAX_SHIFT 4 -#define MSR_PSTATE_DEF_BASE 0xc0010064 /* base of Pstate MSRs */ -#define MSR_PSTATE_STATUS 0xc0010063 /* Pstate Status MSR */ -#define MSR_PSTATE_CTRL 0xc0010062 /* Pstate control MSR */ -#define MSR_PSTATE_CUR_LIMIT 0xc0010061 /* pstate current limit MSR */ +#define MSR_PSTATE_DEF_BASE 0xc0010064U /* base of Pstate MSRs */ +#define MSR_PSTATE_STATUS 0xc0010063U /* Pstate Status MSR */ +#define MSR_PSTATE_CTRL 0xc0010062U /* Pstate control MSR */ +#define MSR_PSTATE_CUR_LIMIT 0xc0010061U /* pstate current limit MSR */ #define MSR_HWCR_CPBDIS_MASK 0x02000000ULL #define ARCH_CPU_FLAG_RESUME 1 diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h index d8a1ba68a6..8b5a1b9bde 100644 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ b/xen/include/acpi/cpufreq/processor_perf.h @@ -5,7 +5,7 @@ #include #include -#define XEN_PX_INIT 0x80000000 +#define XEN_PX_INIT 0x80000000U int powernow_cpufreq_init(void); unsigned int powernow_register_driver(void);