[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH 1/3] xen/arm: platform: address violation of MISRA C Rule 7.2


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Fri, 14 Feb 2025 21:45:21 +0100
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=46.228.253.214
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1739565952; h=DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=ianbSJP6MU89q0CSVCoMWfu1NYhsn60Q7ly6lHvCE5w=; b=LSZJ78zPVUeyrJX1daXA08Y2o23D4PEBao0W/FAGuWqLXGMN2Sj7qVqDCW/rnkSm3dfy QcL3ftJBHbwBl9WTqfeuZQ2TcZBpafKpRgtWkgIhsj3NqHVujbk8FGd1X22BjTz4COqfE lf7IGmFQnN83tRVdwRunlGo/avheqifL2vKZ41w/X3jaA9CHW0NOYRUKQ/mZUIy0y2HGz M93Gpfg2nafSKOLHY0tEm/ub2uwY+dWFh9+DcghaibWzMb80rHYjTYJzgIf/KoCyIYaVR MkHwS/MEv2HJ+AneWfzspYUWWLFKFVSQFJAo5O/cWZ4eem2eDmIRyg8FwygvwscCysF9H zAE2+XkUWYA9S0IrQ4bcGfOmrc09r6o3zypuVTEvaCFUtNvaLCd7PmQ50fzPwBk2ha8Ci fVUFeB6FKvkfrlt3iOqL6pDs0KEm10t5pO7MsgDUadhaclZOT5kQNppamNBvWyWczPoIw HOHEuMGjxMXrDoANjvqglHTE4vPEfjq7JzL6nmE9GIQxElivSmdsUCEnI0D48bY6PbnMj u8XhunfoJjJK4YYFOQeZ+d0BEGtNYlFBVmUUyD3IzhkGMNmIv0TW+r4PWUx/uCMCUH0Zw 5BPOQ3QqJOnKAxz9PtBxpvXXYlMmDH89YhprOxJsd7vMrYu0UR7lDvjx1fNTdr4=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1739565952; b=xPwuqNYGQ0eAGFGRyfwh4anRtFtqfBrMOU7h5kXDlLzVlXBny3XABWt3cSG9B+G9wsA/ PEfQ1l22a8f1gGqtes44KEsui9Dl9SBb98SEghuxT6PpbVbdZGZ+0J2ixHZqNx9IyfNE1 acxg5z+Flu7X5ISXS8NCKG9GCbwS9O0PzK7NOcF0UXncf7bzHIU+X9Byxs2D5yTaOa39F tnReLasA2dMIXUzxHzTI+8mXtf4h9Cqg36P6AgUNhlA+ToF/9rEuyZ+JWe48TS0/gNq7K 4cZVfHQlQz/1JrgR+j3cfOL8AcvGecL/B21ttz4wWM/wMNOBLMorjMl4XhO8qpL+svi1o 0JA7LUmXHaTVbn5uyl7+Z5dR1OF2uu1tGRutVf71cji7qjXvnQeL65Ygk2d1A3z4Soky7 FATO9HwF2tLpEANZC7Aksh54z4EC9Nok3QRn9tLIJD4VvE5YbZ5jqOYjmesuGxkRgl2RD m6OYbJemT7Az2G+jlghogq+0Ikd+X8Qw0Ocs0hiaoZlxyoR66qRXrogjyiBTwBm8/M0yy pQ7fcd+NkbF58XZyHHxvfODuGqP+bb1I2W/Z50Jv9VZtXhG9WM+0SvKy1wPgQexxCXtI0 k0QVGS5mtQ9DgKDM76N+a1t36YXr8wBf66COQ31VwwbloLm6heVI//8MKFR2MyM=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=46.228.253.214
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 14 Feb 2025 20:45:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Rule 7.2 states: "A u or U suffix shall be applied to all integer
constants that are represented in an unsigned type".

Some PM_* constants are unsigned quantities, despite some
of them being representable in a signed type, so a 'U' suffix
should be present.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
This fix is needed in order to keep the rule clean when the
Xen configuration under static analysis is changed later in patch 3
of this series.

Only PM_RSTC_WRCFG_CLR is strictly needed to conform to the rule,
but the other constants have a 'U' added for consistency. PM_RSTC
and PM_WDOG are used as offsets, so in principle they can be negative,
therefore they are left as is.
---
 xen/arch/arm/platforms/brcm-raspberry-pi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c 
b/xen/arch/arm/platforms/brcm-raspberry-pi.c
index 407ec07f63b8..d49460329cc8 100644
--- a/xen/arch/arm/platforms/brcm-raspberry-pi.c
+++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c
@@ -47,11 +47,11 @@ static const struct dt_device_match rpi4_blacklist_dev[] 
__initconst =
 };
 
 
-#define PM_PASSWORD                 0x5a000000
+#define PM_PASSWORD                 0x5a000000U
 #define PM_RSTC                     0x1c
 #define PM_WDOG                     0x24
-#define PM_RSTC_WRCFG_FULL_RESET    0x00000020
-#define PM_RSTC_WRCFG_CLR           0xffffffcf
+#define PM_RSTC_WRCFG_FULL_RESET    0x00000020U
+#define PM_RSTC_WRCFG_CLR           0xffffffcfU
 
 static void __iomem *rpi4_map_watchdog(void)
 {
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.