]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/x86: Use %*pb[l] instead of cpumask_scn{,list}printf()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 6 Sep 2018 11:21:51 +0000 (11:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Nov 2018 16:25:54 +0000 (16:25 +0000)
This removes all use of keyhandler_scratch as a bounce-buffer for the rendered
string.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/crash.c
xen/arch/x86/irq.c

index 1eec6319ca86e37f4140dee226e6161bdaffe25b..30cdb0640117cb3d7d4b28eb150c48496ce0a215 100644 (file)
@@ -535,9 +535,12 @@ void mcheck_cmn_handler(const struct cpu_user_regs *regs)
             mc_panic("MCE: No CPU found valid MCE, need reset");
         if ( !cpumask_empty(&mce_fatal_cpus) )
         {
-            char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
-            ebufp = ebuf + strlen(ebuf);
-            cpumask_scnprintf(ebufp, 95 - strlen(ebuf), &mce_fatal_cpus);
+            char ebuf[96];
+
+            snprintf(ebuf, sizeof(ebuf),
+                     "MCE: Fatal error happened on CPUs %*pb",
+                     nr_cpu_ids, cpumask_bits(&mce_fatal_cpus));
+
             mc_panic(ebuf);
         }
         atomic_set(&found_error, 0);
index 8d742582affce05629fc2501f53aac8caa2bd6cc..60c98b6175beecfd732cb8f3215baeac18cd670b 100644 (file)
@@ -159,11 +159,8 @@ static void nmi_shootdown_cpus(void)
     if ( cpumask_empty(&waiting_to_crash) )
         printk("Shot down all CPUs\n");
     else
-    {
-        cpulist_scnprintf(keyhandler_scratch, sizeof keyhandler_scratch,
-                          &waiting_to_crash);
-        printk("Failed to shoot down CPUs {%s}\n", keyhandler_scratch);
-    }
+        printk("Failed to shoot down CPUs {%*pbl}\n",
+               nr_cpu_ids, cpumask_bits(&waiting_to_crash));
 
     /* Crash shutdown any IOMMU functionality as the crashdump kernel is not
      * happy when booting if interrupt/dma remapping is still enabled */
index 35e7de594fd85749401bbb409fae174a037dec57..8b44d6ce0b86b0ea210a4b26484ea4ddf05deedc 100644 (file)
@@ -2302,11 +2302,8 @@ static void dump_irqs(unsigned char key)
 
         spin_lock_irqsave(&desc->lock, flags);
 
-        cpumask_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch),
-                          desc->affinity);
-        printk("   IRQ:%4d affinity:%s vec:%02x type=%-15s"
-               " status=%08x ",
-               irq, keyhandler_scratch, desc->arch.vector,
+        printk("   IRQ:%4d affinity:%*pb vec:%02x type=%-15s status=%08x ",
+               irq, nr_cpu_ids, cpumask_bits(desc->affinity), desc->arch.vector,
                desc->handler->typename, desc->status);
 
         if ( ssid )