From nobody Sun Feb 8 23:27:15 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 1691058485171953.6326533517993; Thu, 3 Aug 2023 03:28:05 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.576226.902148 (Exim 4.92) (envelope-from ) id 1qRVYR-0002FD-RF; Thu, 03 Aug 2023 10:27:39 +0000 Received: by outflank-mailman (output) from mailman id 576226.902148; Thu, 03 Aug 2023 10:27:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qRVYR-0002F6-O1; Thu, 03 Aug 2023 10:27:39 +0000 Received: by outflank-mailman (input) for mailman id 576226; Thu, 03 Aug 2023 10:27:39 +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 1qRVYR-0000aV-6q for xen-devel@lists.xenproject.org; Thu, 03 Aug 2023 10:27:39 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5e062244-31e8-11ee-8613-37d641c3527e; Thu, 03 Aug 2023 12:27:37 +0200 (CEST) Received: from beta.station (net-188-218-251-179.cust.vodafonedsl.it [188.218.251.179]) by support.bugseng.com (Postfix) with ESMTPSA id D8B1D4EE0737; Thu, 3 Aug 2023 12:27:36 +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: 5e062244-31e8-11ee-8613-37d641c3527e From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Gianluca Luparini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Simone Ballarin Subject: [XEN PATCH 12/13] xen/common: address violations of MISRA C:2012 Rule 7.3 Date: Thu, 3 Aug 2023 12:22:27 +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: 1691058485740100001 Content-Type: text/plain; charset="utf-8" From: Gianluca Luparini The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline states: "The lowercase character 'l' shall not be used in a literal suffix". Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity. If the "u" suffix is used near "L", use the "U" suffix instead, for consist= ency. The changes in this patch are mechanical. Signed-off-by: Gianluca Luparini Signed-off-by: Simone Ballarin Reviewed-by: Stefano Stabellini --- xen/common/page_alloc.c | 6 +++--- xen/common/rangeset.c | 2 +- xen/common/softirq.c | 8 ++++---- xen/common/vsprintf.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index e40473f71e..03b63d0ee7 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2380,7 +2380,7 @@ int assign_pages( if ( unlikely(nr > d->max_pages - tot_pages) ) { gprintk(XENLOG_INFO, "Over-allocation for %pd: %Lu > %u\n", - d, tot_pages + 0ull + nr, d->max_pages); + d, tot_pages + 0ULL + nr, d->max_pages); rc =3D -E2BIG; goto out; } @@ -2392,7 +2392,7 @@ int assign_pages( { gprintk(XENLOG_INFO, "Excess allocation for %pd: %Lu (%u extra)\n", - d, d->tot_pages + 0ull + nr, d->extra_pages); + d, d->tot_pages + 0ULL + nr, d->extra_pages); if ( pg[0].count_info & PGC_extra ) d->extra_pages -=3D nr; rc =3D -E2BIG; @@ -2460,7 +2460,7 @@ struct page_info *alloc_domheap_pages( { unsigned long i; =20 - for ( i =3D 0; i < (1ul << order); i++ ) + for ( i =3D 0; i < (1UL << order); i++ ) { ASSERT(!pg[i].count_info); pg[i].count_info =3D PGC_extra; diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c index a6ef264046..f3baf52ab6 100644 --- a/xen/common/rangeset.c +++ b/xen/common/rangeset.c @@ -393,7 +393,7 @@ static int cf_check merge(unsigned long s, unsigned lon= g e, void *data) =20 int rangeset_merge(struct rangeset *r1, struct rangeset *r2) { - return rangeset_report_ranges(r2, 0, ~0ul, merge, r1); + return rangeset_report_ranges(r2, 0, ~0UL, merge, r1); } =20 int rangeset_add_singleton( diff --git a/xen/common/softirq.c b/xen/common/softirq.c index 063e93cbe3..321d26902d 100644 --- a/xen/common/softirq.c +++ b/xen/common/softirq.c @@ -29,7 +29,7 @@ static void __do_softirq(unsigned long ignore_mask) { unsigned int i, cpu; unsigned long pending; - bool rcu_allowed =3D !(ignore_mask & (1ul << RCU_SOFTIRQ)); + bool rcu_allowed =3D !(ignore_mask & (1UL << RCU_SOFTIRQ)); =20 ASSERT(!rcu_allowed || rcu_quiesce_allowed()); =20 @@ -57,12 +57,12 @@ static void __do_softirq(unsigned long ignore_mask) void process_pending_softirqs(void) { /* Do not enter scheduler as it can preempt the calling context. */ - unsigned long ignore_mask =3D (1ul << SCHEDULE_SOFTIRQ) | - (1ul << SCHED_SLAVE_SOFTIRQ); + unsigned long ignore_mask =3D (1UL << SCHEDULE_SOFTIRQ) | + (1UL << SCHED_SLAVE_SOFTIRQ); =20 /* Block RCU processing in case of rcu_read_lock() held. */ if ( !rcu_quiesce_allowed() ) - ignore_mask |=3D 1ul << RCU_SOFTIRQ; + ignore_mask |=3D 1UL << RCU_SOFTIRQ; =20 ASSERT(!in_irq() && local_irq_is_enabled()); __do_softirq(ignore_mask); diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index 94c1ba7257..c49631c0a4 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -225,7 +225,7 @@ static char *print_bitmap_string(char *str, const char = *end, */ for ( i =3D ROUNDUP(nr_bits, CHUNKSZ) - CHUNKSZ; i >=3D 0; i -=3D CHUN= KSZ ) { - unsigned int chunkmask =3D (1ull << chunksz) - 1; + unsigned int chunkmask =3D (1ULL << chunksz) - 1; unsigned int word =3D i / BITS_PER_LONG; unsigned int offset =3D i % BITS_PER_LONG; unsigned long val =3D (bitmap[word] >> offset) & chunkmask; --=20 2.34.1