Skip to content

Commit

Permalink
AFS: Fix compilation warning
Browse files Browse the repository at this point in the history
Fix the following warning:

  fs/afs/dir.c: In function 'afs_d_revalidate':
  fs/afs/dir.c:567: warning: 'fid.vnode' may be used uninitialized in this function
  fs/afs/dir.c:567: warning: 'fid.unique' may be used uninitialized in this function

by marking the 'fid' variable as an uninitialized_var.  The problem is
that gcc doesn't always manage to work out that fid is always set on the
path through the function that uses it.

Cc: [email protected]
Cc: [email protected]
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Artem Bityutskiy authored and torvalds committed Jul 12, 2009
1 parent 405f557 commit dd0d9a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/afs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
{
struct afs_vnode *vnode, *dir;
struct afs_fid fid;
struct afs_fid uninitialized_var(fid);
struct dentry *parent;
struct key *key;
void *dir_version;
Expand Down

0 comments on commit dd0d9a4

Please sign in to comment.