Skip to content

Commit

Permalink
sysfs: add unsigned long cast to prevent compile warning
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Heiko Carstens authored and Greg Kroah-Hartman committed Sep 26, 2011
1 parent bcbe4f9 commit c4253cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4253cb

Please sign in to comment.