Skip to content

Commit

Permalink
fuse: mark variables uninitialized
Browse files Browse the repository at this point in the history
gcc 4.6.3 complains about uninitialized variables in fs/fuse/control.c:

  CC      fs/fuse/control.o
fs/fuse/control.c: In function 'fuse_conn_congestion_threshold_write':
fs/fuse/control.c:165:29: warning: 'val' may be used uninitialized in this function [-Wuninitialized]
fs/fuse/control.c: In function 'fuse_conn_max_background_write':
fs/fuse/control.c:128:23: warning: 'val' may be used uninitialized in this function [-Wuninitialized]

fuse_conn_limit_write() will always return non-zero unless the &val
is modified, so the warning is misleading. Let the compiler know
about it by marking 'val' with 'uninitialized_var'.

Signed-off-by: Daniel Mack <[email protected]>
Cc: Brian Foster <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
zonque authored and Miklos Szeredi committed Sep 3, 2012
1 parent 8d39d80 commit 381bf7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/fuse/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,
const char __user *buf,
size_t count, loff_t *ppos)
{
unsigned val;
unsigned uninitialized_var(val);
ssize_t ret;

ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
Expand Down Expand Up @@ -154,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,
const char __user *buf,
size_t count, loff_t *ppos)
{
unsigned val;
unsigned uninitialized_var(val);
ssize_t ret;

ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
Expand Down

0 comments on commit 381bf7c

Please sign in to comment.