[coreboot-gerrit] New patch to review for filo: 9cf988c Correct some format strings

Nico Huber (nico.huber@secunet.com) gerrit at coreboot.org
Sun May 26 15:20:17 CEST 2013


Nico Huber (nico.huber at secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3296

-gerrit

commit 9cf988cd93672fd0f765c3681a615132e30f0075
Author: Nico Huber <nico.huber at secunet.com>
Date:   Sun May 26 14:23:45 2013 +0200

    Correct some format strings
    
    Correct format strings to get rid of some warnings.
    
    Change-Id: Iaf30b5b95159c71daded95e6a603cdebd40d81a6
    Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
 fs/fsys_ext2fs.c     | 16 ++++++++--------
 fs/fsys_minix.c      |  2 +-
 fs/vfs.c             |  6 +++---
 main/grub/builtins.c |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/fsys_ext2fs.c b/fs/fsys_ext2fs.c
index 96e2e68..93a3ee6 100644
--- a/fs/fsys_ext2fs.c
+++ b/fs/fsys_ext2fs.c
@@ -392,7 +392,7 @@ struct ext4_extent_header
 void
 dump_super(struct ext2_super_block *s)
 {
-    printf(" superblock 0x%x:\n", s);
+    printf(" superblock 0x%p:\n", s);
     printf("  inodes=%d\n", le32_to_cpu(s->s_inodes_count));
     printf("  blocks=%d\n", le32_to_cpu(s->s_blocks_count));
     printf("  reserved=%d\n", le32_to_cpu(s->s_r_blocks_count));
@@ -410,7 +410,7 @@ dump_super(struct ext2_super_block *s)
 void
 dump_group_desc(struct ext2_group_desc *g)
 {
-    printf(" group_desc 0x%x:\n", g);
+    printf(" group_desc 0x%p:\n", g);
     printf("  b_bmap block=%d\n", le32_to_cpu(g->bg_block_bitmap));
     printf("  i_bmap block=%d\n", le32_to_cpu(g->bg_inode_bitmap));
     printf("  i_tab block=%d\n", le32_to_cpu(g->bg_inode_table));
@@ -422,7 +422,7 @@ dump_group_desc(struct ext2_group_desc *g)
 void
 dump_inode(struct ext2_inode *i)
 {
-    printf(" inode 0x%x:\n", i);
+    printf(" inode 0x%p:\n", i);
     printf("  mode=%o\n", le16_to_cpu(i->i_mode));
     printf("  uid=%d\n", le16_to_cpu(i->i_uid));
     printf("  gid=%d\n", le16_to_cpu(i->i_gid));
@@ -709,7 +709,7 @@ ext2fs_read (char *buf, int len)
   int size = 0;
 
 #ifdef E2DEBUG
-  printf("ext2fs_read(0x%x, %d)\n", buf, len);
+  printf("ext2fs_read(0x%p, %d)\n", buf, len);
   dump_inode(INODE);
   dump_inode_data((unsigned char *)INODE, sizeof (struct ext2_inode));
 #endif /* E2DEBUG */
@@ -872,8 +872,8 @@ ext2fs_dir (char *dirname)
 	(((current_ino - 1) % le32_to_cpu(SUPERBLOCK->s_inodes_per_group))
 	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
 #ifdef E2DEBUG
-      printf ("ext2fs_dir: itab_blk=%d, i_in_grp=%d, log2=%d\n", 
-	 le32_to_cpu(gdp[desc].bg_inode_table),
+      printf ("ext2fs_dir: itab_blk=%d, i_in_grp=%d, log2=%lu\n",
+	 le32_to_cpu(ext4_gdp[desc].bg_inode_table),
 	 ((current_ino - 1) % le32_to_cpu(SUPERBLOCK->s_inodes_per_group)),
 	 log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
       printf ("ext2fs_dir: inode table fsblock=%d\n", ino_blk);
@@ -893,7 +893,7 @@ ext2fs_dir (char *dirname)
       printf ("ext2fs_dir: ipb=%d, sizeof(inode)=%d\n",
 	      EXT2_INODES_PER_BLOCK (SUPERBLOCK),
 	      EXT2_INODE_SIZE(SUPERBLOCK));
-      printf ("ext2fs_dir: inode=%x, raw_inode=%x\n", INODE, raw_inode);
+      printf ("ext2fs_dir: inode=%p, raw_inode=%p\n", INODE, raw_inode);
       printf ("ext2fs_dir: offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
       dump_inode(raw_inode);
       dump_inode_data((unsigned char *)INODE, EXT2_BLOCK_SIZE(SUPERBLOCK));
@@ -1063,7 +1063,7 @@ ext2fs_dir (char *dirname)
 	  else
 	       map = ext2fs_block_map (blk);
 #ifdef E2DEBUG
-	  printf ("ext2fs_dir: fs block=%d\n", map);
+	  printf ("ext2fs_dir: fs block=%ld\n", map);
 #endif /* E2DEBUG */
 	  mapblock2 = -1;
 	  if (map < 0) 
diff --git a/fs/fsys_minix.c b/fs/fsys_minix.c
index faa1710..f9b7519 100644
--- a/fs/fsys_minix.c
+++ b/fs/fsys_minix.c
@@ -476,7 +476,7 @@ minix_dir (char *dirname)
 	     the disk */
 	  map = minix_block_map (blk);
 #ifdef DEBUG_MINIX
-	  printf ("fs block=%d\n", map);
+	  printf ("fs block=%ld\n", map);
 #endif
 	  mapblock2 = -1;
 	  if ((map < 0) || !minix_rdfsb (map, DATABLOCK2))
diff --git a/fs/vfs.c b/fs/vfs.c
index 18db6ec..1cab143 100644
--- a/fs/vfs.c
+++ b/fs/vfs.c
@@ -213,13 +213,13 @@ int file_read(void *buf, unsigned long len)
 
 	errnum = 0;
 
-	debug("reading %d bytes, offset 0x%x\n", len, filepos);
+	debug("reading %lu bytes, offset 0x%x\n", len, filepos);
 	return fsys->read_func(buf, len);
 }
 
 unsigned long file_seek(unsigned long offset)
 {
-	debug("seeking to 0x%x\n", offset);
+	debug("seeking to 0x%lx\n", offset);
 	filepos = offset;
 	return filepos;
 }
@@ -231,7 +231,7 @@ unsigned long file_size(void)
 
 void file_set_size(unsigned long size)
 {
-	debug("updating file size to %d bytes\n", size);
+	debug("updating file size to %lu bytes\n", size);
 
 	filemax = size;
 	using_devsize = 0;
diff --git a/main/grub/builtins.c b/main/grub/builtins.c
index e40663b..1297ad0 100644
--- a/main/grub/builtins.c
+++ b/main/grub/builtins.c
@@ -802,7 +802,7 @@ void copy_path_to_filo_bootline(char *arg, char *path, int use_rootdev, int appe
 			strlcat(path, buffer, BOOT_LINE_LENGTH);
 		}
 		if (addr != -1) {
-			snprintf(buffer, 31, "@0x%x", addr);
+			snprintf(buffer, 31, "@0x%lx", addr);
 			strlcat(path, buffer, BOOT_LINE_LENGTH);
 		}
 		buffer[0]=':';



More information about the coreboot-gerrit mailing list