From nobody Mon Feb 9 19:55:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 168915807140768.89825285409631; Wed, 12 Jul 2023 03:34:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.562213.878867 (Exim 4.92) (envelope-from ) id 1qJXAV-0008Cq-VW; Wed, 12 Jul 2023 10:33:59 +0000 Received: by outflank-mailman (output) from mailman id 562213.878867; Wed, 12 Jul 2023 10:33:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qJXAV-00087p-G8; Wed, 12 Jul 2023 10:33:59 +0000 Received: by outflank-mailman (input) for mailman id 562213; Wed, 12 Jul 2023 10:33:57 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qJXAT-0006Dd-NS for xen-devel@lists.xenproject.org; Wed, 12 Jul 2023 10:33:57 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9af0ad29-209f-11ee-b239-6b7b168915f2; Wed, 12 Jul 2023 12:33:56 +0200 (CEST) Received: from beta.bugseng.com (unknown [37.161.151.90]) by support.bugseng.com (Postfix) with ESMTPSA id AF8ED4EE0C8B; Wed, 12 Jul 2023 12:33:55 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 9af0ad29-209f-11ee-b239-6b7b168915f2 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Juergen Gross , Stefano Stabellini , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder , Simone Ballarin Subject: [XEN PATCH v3 09/15] xen/public: fix violations of MISRA C:2012 Rule 7.2 Date: Wed, 12 Jul 2023 12:32:10 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1689158073291100003 Content-Type: text/plain; charset="utf-8" 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. For the sake of uniformity, the following changes are made: - add the 'U' suffix to integer constants before the '?' operator Signed-off-by: Gianluca Luparini Signed-off-by: Simone Ballarin Reviewed-by: Juergen Gross Reviewed-by: Stefano Stabellini --- Changes in v3: - change 'Signed-off-by' ordering - change commit message Changes in v2: - minor change to commit title - change commit message - correct macros code style --- xen/include/public/io/ring.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h index 025939278b..0cae4367be 100644 --- a/xen/include/public/io/ring.h +++ b/xen/include/public/io/ring.h @@ -36,11 +36,11 @@ typedef unsigned int RING_IDX; =20 /* Round a 32-bit unsigned constant down to the nearest power of two. */ -#define __RD2(_x) (((_x) & 0x00000002) ? 0x2 : ((_x) & 0= x1)) -#define __RD4(_x) (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2 : __RD2(_x)) -#define __RD8(_x) (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4 : __RD4(_x)) -#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8 : __RD8(_x)) -#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x= )) +#define __RD2(x) (((x) & 0x00000002U) ? 0x2 : ((x) & = 0x1)) +#define __RD4(x) (((x) & 0x0000000cU) ? __RD2((x) >> 2) << 2 : __RD2(x= )) +#define __RD8(x) (((x) & 0x000000f0U) ? __RD4((x) >> 4) << 4 : __RD4(x= )) +#define __RD16(x) (((x) & 0x0000ff00U) ? __RD8((x) >> 8) << 8 : __RD8(x= )) +#define __RD32(x) (((x) & 0xffff0000U) ? __RD16((x) >> 16) << 16 : __RD16(= x)) =20 /* * Calculate size of a shared ring, given the total available space for the --=20 2.41.0