sysfs: add unsigned long cast to prevent compile warning
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 22 Sep 2011 17:34:33 +0000 (19:34 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Sep 2011 23:21:15 +0000 (16:21 -0700)
"sysfs: use rb-tree for inode number lookup" added a new printk which
causes a new compile warning on s390 (and few other architectures):

fs/sysfs/dir.c: In function 'sysfs_link_sibling':
fs/sysfs/dir.c:63:4: warning: format '%lx' expects argument of type
  'long unsigned int', but argument 2 has type 'ino_t' [-Wform

Add an explicit unsigned long cast since ino_t is an unsigned long on
most architectures.

Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/dir.c

index c3646d93a032b9b90e35830551b5b6ac7e7e1361..83bb9d1f30aac612c0d4b0c1d2c28fceee3878e7 100644 (file)
@@ -60,7 +60,8 @@ static void sysfs_link_sibling(struct sysfs_dirent *sd)
                } else if (sd->s_ino > node->s_ino) {
                        p = &node->inode_node.rb_right;
                } else {
-                       printk(KERN_CRIT "sysfs: inserting duplicate inode '%lx'\n", sd->s_ino);
+                       printk(KERN_CRIT "sysfs: inserting duplicate inode '%lx'\n",
+                              (unsigned long) sd->s_ino);
                        BUG();
                }
 #undef node