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

[XEN PATCH 12/13] xen/common: address violations of MISRA C:2012 Rule 7.3



From: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>

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 consistency.

The changes in this patch are mechanical.

Signed-off-by: Gianluca Luparini <gianluca.luparini@xxxxxxxxxxx>
Signed-off-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
---
 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 = -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 -= nr;
             rc = -E2BIG;
@@ -2460,7 +2460,7 @@ struct page_info *alloc_domheap_pages(
         {
             unsigned long i;
 
-            for ( i = 0; i < (1ul << order); i++ )
+            for ( i = 0; i < (1UL << order); i++ )
             {
                 ASSERT(!pg[i].count_info);
                 pg[i].count_info = 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 long e, 
void *data)
 
 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);
 }
 
 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 = !(ignore_mask & (1ul << RCU_SOFTIRQ));
+    bool rcu_allowed = !(ignore_mask & (1UL << RCU_SOFTIRQ));
 
     ASSERT(!rcu_allowed || rcu_quiesce_allowed());
 
@@ -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 = (1ul << SCHEDULE_SOFTIRQ) |
-                                (1ul << SCHED_SLAVE_SOFTIRQ);
+    unsigned long ignore_mask = (1UL << SCHEDULE_SOFTIRQ) |
+                                (1UL << SCHED_SLAVE_SOFTIRQ);
 
     /* Block RCU processing in case of rcu_read_lock() held. */
     if ( !rcu_quiesce_allowed() )
-        ignore_mask |= 1ul << RCU_SOFTIRQ;
+        ignore_mask |= 1UL << RCU_SOFTIRQ;
 
     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 = ROUNDUP(nr_bits, CHUNKSZ) - CHUNKSZ; i >= 0; i -= CHUNKSZ )
     {
-        unsigned int chunkmask = (1ull << chunksz) - 1;
+        unsigned int chunkmask = (1ULL << chunksz) - 1;
         unsigned int word      = i / BITS_PER_LONG;
         unsigned int offset    = i % BITS_PER_LONG;
         unsigned long val      = (bitmap[word] >> offset) & chunkmask;
-- 
2.34.1




 


Rackspace

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