[PATCH 05/15] libcpu/powerpc/mpc6xx/mmu/bat.c: Fix printf() format warnings.

Joel Sherrill joel at rtems.org
Mon Oct 3 22:58:02 UTC 2016


---
 c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
index c848f4c..9a22e42 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
@@ -335,30 +335,30 @@ setbat (int typ, int bat_index, unsigned long virt, unsigned long phys,
   ubat bat;
 
   if (check_bat_index (bat_index)) {
-    printk ("Invalid BAT index\n", bat_index);
+    printk ("Invalid BAT index (%d)\n", bat_index);
     return -1;
   }
 
   if ((int) (bl = check_bat_size (size)) < 0) {
-    printk ("Invalid BAT size\n", size);
+    printk ("Invalid BAT size (%d)\n", size);
     return -1;
   }
 
   if (virt & (size - 1)) {
-    printk ("BAT effective address 0x%08x misaligned (size is 0x%08x)\n",
+    printk ("BAT effective address 0x%08lx misaligned (size is 0x%08x)\n",
             virt, size);
     return -1;
   }
 
   if (phys & (size - 1)) {
-    printk ("BAT physical address 0x%08x misaligned (size is 0x%08x)\n", phys,
-            size);
+    printk ("BAT physical address 0x%08lx misaligned (size is 0x%08x)\n",
+            phys, size);
     return -1;
   }
 
   if (virt + size - 1 < virt) {
-    printk ("BAT range invalid: wraps around zero 0x%08x..0x%08x\n", virt,
-            virt + size - 1);
+    printk ("BAT range invalid: wraps around zero 0x%08lx..0x%08lx\n",
+            virt, virt + size - 1);
     return -1;
   }
 
@@ -367,8 +367,9 @@ setbat (int typ, int bat_index, unsigned long virt, unsigned long phys,
 	return -1;
   }
 
-/* must protect the bat_addrs table -- since this routine is only used for board setup
- * or similar special purposes we don't bother about interrupt latency too much.
+/* must protect the bat_addrs table -- since this routine is only used for
+ * board setup or similar special purposes we don't bother about interrupt
+ * latency too much.
  */
   rtems_interrupt_disable (level);
 
@@ -383,7 +384,7 @@ setbat (int typ, int bat_index, unsigned long virt, unsigned long phys,
   err = check_overlap (typ, virt, size);
   if ((size >= (1 << 17)) && (err >= 0) && (err != bat_index)) {
     rtems_interrupt_enable (level);
-    printk ("BATs must not overlap; area 0x%08x..0x%08x hits %cBAT %i\n",
+    printk ("BATs must not overlap; area 0x%08lx..0x%08lx hits %cBAT %i\n",
             virt, virt + size, (TYP_I == typ ? 'I' : 'D'), err);
     return -1;
   }
@@ -495,13 +496,14 @@ getbat (int typ, int idx, unsigned long *pu, unsigned long *pl)
     ubat b;
     b.words.u = u;
     b.words.l = l;
-    printk ("Raw %cBAT %i contents; UPPER: (0x%08x)", (TYP_I == typ ? 'I' : 'D'), idx, u);
+    printk ("Raw %cBAT %i contents; UPPER: (0x%08lx)",
+      (TYP_I == typ ? 'I' : 'D'), idx, u);
     printk (" BEPI: 0x%08x", b.bat.batu.bepi);
-    printk (" BL: 0x%08x", (u >> 2) & ((1 << 15) - 1));
+    printk (" BL: 0x%08lx", (u >> 2) & ((1 << 15) - 1));
     printk (" VS: 0b%i", b.bat.batu.vs);
     printk (" VP: 0b%i", b.bat.batu.vp);
     printk ("\n");
-    printk ("                     LOWER: (0x%08x)", l);
+    printk ("                     LOWER: (0x%08lx)", l);
     printk ("  RPN: 0x%08x", b.bat.batl.brpn);
     printk (" wimg:   0b%1i%1i%1i%1i", b.bat.batl.w, b.bat.batl.i,
             b.bat.batl.m, b.bat.batl.g);
@@ -509,7 +511,7 @@ getbat (int typ, int idx, unsigned long *pu, unsigned long *pl)
     printk ("\n");
     printk ("Covering EA Range: ");
     if (bat_in_use[typ] & (1 << idx))
-      printk ("0x%08x .. 0x%08x\n", bat_addrs[typ][idx].start,
+      printk ("0x%08lx .. 0x%08lx\n", bat_addrs[typ][idx].start,
               bat_addrs[typ][idx].limit);
     else
       printk ("<none> (BAT off)\n");
-- 
1.8.3.1




More information about the devel mailing list