Re: [PATCH] Silence compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Benny Halevy wrote:

  On 2011-10-16 17:06, Jim Rees wrote:
  > fs/nfs/callback_proc.c: In function ‘do_callback_layoutrecall’:
  > fs/nfs/callback_proc.c:115:26: warning: ‘lo’ may be used uninitialized in this function
  > 
  > No functional change. If no layout is found, we'll return before  using
  > "lo".
  > 
  > Signed-off-by: Jim Rees <rees@xxxxxxxxx>
  > ---
  >  fs/nfs/callback_proc.c |    2 +-
  >  1 files changed, 1 insertions(+), 1 deletions(-)
  > 
  > diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
  > index 43926ad..93633f1 100644
  > --- a/fs/nfs/callback_proc.c
  > +++ b/fs/nfs/callback_proc.c
  > @@ -112,7 +112,7 @@ static u32 initiate_file_draining(struct nfs_client *clp,
  >  				  struct cb_layoutrecallargs *args)
  >  {
  >  	struct nfs_server *server;
  > -	struct pnfs_layout_hdr *lo;
  > +	struct pnfs_layout_hdr *lo = NULL;
  >  	struct inode *ino;
  >  	bool found = false;
  >  	u32 rv = NFS4ERR_NOMATCHING_LAYOUT;
  
  Hmm, the warning seems bogus since we use lo only iff found==true
  and it is set iff found==true
  I wonder why I don't see that warning.
  What compiler/version are you using?

gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2

I don't remember seeing this warning before either, but I can't think what I
might have changed that would make a difference.  I did turn on SMP, which I
didn't have before (non-SMP kernels don't seem to work on the latest
Virtualbox).  And yes, the warning is bogus, but should be fixed anyway.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux