All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: fs/nfsd/nfs4xdr.c:2004:9: warning: Identical condition 'status', second condition is always false
Date: Tue, 10 Nov 2020 14:02:15 +0800	[thread overview]
Message-ID: <202011101408.vO2gD8dm-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3866 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Frank van der Linden <fllinden@amazon.com>
CC: Chuck Lever <chuck.lever@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   407ab579637ced6dc32cfb2295afb7259cca4b22
commit: 23e50fe3a5e6045a573c69d4b0e3d78aa6183323 nfsd: implement the xattr functions and en/decode logic
date:   4 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 4 months ago
compiler: h8300-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> fs/nfsd/nfs4xdr.c:2004:9: warning: Identical condition 'status', second condition is always false [identicalConditionAfterEarlyExit]
    return status;
           ^
   fs/nfsd/nfs4xdr.c:1996:6: note: first condition
    if (status)
        ^
   fs/nfsd/nfs4xdr.c:2004:9: note: second condition
    return status;
           ^
   fs/nfsd/nfs4xdr.c:1013:2: warning: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch]
    READ_BUF(4);
    ^
   fs/nfsd/nfs4xdr.c:991:4: note: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing?
      COPYMEM(open->op_verf.data, NFS4_VERIFIER_SIZE);
      ^
   fs/nfsd/nfs4xdr.c:1013:2: note: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing?
    READ_BUF(4);
    ^

vim +/status +2004 fs/nfsd/nfs4xdr.c

23e50fe3a5e6045 Frank van der Linden 2020-06-23  1981  
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1982  /*
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1983   * A GETXATTR op request comes without a length specifier. We just set the
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1984   * maximum length for the reply based on XATTR_SIZE_MAX and the maximum
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1985   * channel reply size. nfsd_getxattr will probe the length of the xattr,
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1986   * check it against getxa_len, and allocate + return the value.
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1987   */
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1988  static __be32
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1989  nfsd4_decode_getxattr(struct nfsd4_compoundargs *argp,
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1990  		      struct nfsd4_getxattr *getxattr)
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1991  {
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1992  	__be32 status;
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1993  	u32 maxcount;
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1994  
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1995  	status = nfsd4_decode_xattr_name(argp, &getxattr->getxa_name);
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1996  	if (status)
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1997  		return status;
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1998  
23e50fe3a5e6045 Frank van der Linden 2020-06-23  1999  	maxcount = svc_max_payload(argp->rqstp);
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2000  	maxcount = min_t(u32, XATTR_SIZE_MAX, maxcount);
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2001  
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2002  	getxattr->getxa_len = maxcount;
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2003  
23e50fe3a5e6045 Frank van der Linden 2020-06-23 @2004  	return status;
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2005  }
23e50fe3a5e6045 Frank van der Linden 2020-06-23  2006  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

                 reply	other threads:[~2020-11-10  6:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202011101408.vO2gD8dm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.