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

Re: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012 Rule 7.2


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 5 Jul 2023 16:34:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X6DZn+acH4T7vQpD2hCMzs9pM95ym7skUiR8tWqfbaU=; b=f+pOJhm4/8Uh4+TzrQOgtZ+dsuvFwXeJlfj6QCmqVrWjlvxixTseo07R6SAmulDy/2IEhtcnNKMTbwswr1jntrLCpa1Uvv67OaJmUyjiNWKrR/e2a9YXgg3dO0Qc9jo6QRAGxpomMVL9/MFgC3FNFrucyez5FpNiwVoZrGQS6NPAFkO8GKEbpt62+UgLMhNGjOg6twwQCfW+PGAJMRkFD1QN2nVcZ+yxgyo4yWlKsjiSc7B+BCk4hhmFYfFGg9Z8KUBHaznTa7IzerSZAqkwAiqZcCBDbtMnXrEe/rHQLvd+G6tIV5LzMAGyT6LJbHHK51A2GHybm+GxL6wUbVJcfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Huvhd64kMHxuPrzbHUhH0qpGiL1EW1ZEwABaE79BdkxHKaeSbSWlF59Auwdt0Ir2+TplbMDHfUNIZCZxpkUasooPe821nG1og6HzqmDveyHJQ37dzG4IRgiAVj0pMnsrUhn6PMavE2CjL68NEa8YGjpDuuxj/GsTIY9imozw1vAx1KtfrN2vxczZ7Jpl/bOm2jxGfG1hMRQDadqC4bPJnxrtybVnwWRl/5xTZK6ho1Z0A3iOww9uxGN+FdehhP3fQNkxRbVIhLOcCLezExSrTtUiBepYmcdPDpj5PRS4d3jDbAJuLkfTQxxomm2WuMix7w2u/1RyGnzOSjSjSMH3mQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Xenia Ragiadakou <Xenia.Ragiadakou@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Wed, 05 Jul 2023 16:34:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZr1VIs7cSnKcK+EWsrhmpc3alsa+rXlmA
  • Thread-topic: [XEN PATCH v2 06/13] xen/efi: fix violations of MISRA C:2012 Rule 7.2


> On 5 Jul 2023, at 16:26, Simone Ballarin <simone.ballarin@xxxxxxxxxxx> wrote:
> 
> From: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>
> 
> 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: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
> Signed-off-by: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>

Changes looks good to me, probably Jan knows better this part

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>

> ---
> Changes in v2:
> - minor change to commit title
> - change commit message
> - remove changes in 'efibind.h', 'efiapi.h', 'efidef.h' and 'efiprot.h'
> ---
> xen/common/efi/boot.c    | 8 ++++----
> xen/common/efi/runtime.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index c5850c26af..28a57fe434 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -34,13 +34,13 @@
> #define EFI_REVISION(major, minor) (((major) << 16) | (minor))
> 
> #define SMBIOS3_TABLE_GUID \
> -  { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 
> 0x94} }
> +  { 0xf2fd1544U, 0x9794U, 0x4a2cU, {0x99U, 0x2eU, 0xe5U, 0xbbU, 0xcfU, 
> 0x20U, 0xe3U, 0x94U} }
> #define SHIM_LOCK_PROTOCOL_GUID \
> -  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 
> 0x23} }
> +  { 0x605dab50U, 0xe046U, 0x4300U, {0xabU, 0xb6U, 0x3dU, 0xd8U, 0x10U, 
> 0xddU, 0x8bU, 0x23U} }
> #define APPLE_PROPERTIES_PROTOCOL_GUID \
> -  { 0x91bd12fe, 0xf6c3, 0x44fb, { 0xa5, 0xb7, 0x51, 0x22, 0xab, 0x30, 0x3a, 
> 0xe0} }
> +  { 0x91bd12feU, 0xf6c3U, 0x44fbU, { 0xa5U, 0xb7U, 0x51U, 0x22U, 0xabU, 
> 0x30U, 0x3aU, 0xe0U} }
> #define EFI_SYSTEM_RESOURCE_TABLE_GUID    \
> -  { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 
> 0x80} }
> +  { 0xb122a263U, 0x3661U, 0x4f68U, {0x99U, 0x29U, 0x78U, 0xf8U, 0xb0U, 
> 0xd6U, 0x21U, 0x80U} }
> #define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1
> 
> typedef struct {
> diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
> index 13b0975866..5cb7504c96 100644
> --- a/xen/common/efi/runtime.c
> +++ b/xen/common/efi/runtime.c
> @@ -698,7 +698,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
> #ifndef COMPAT
>     op->status = status;
> #else
> -    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
> +    op->status = (status & 0x3fffffffU) | ((status >> 32) & 0xc0000000U);
> #endif
> 
>     return rc;
> -- 
> 2.41.0
> 
> 




 


Rackspace

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