public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Aya Levin <ayal@mellanox.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Saeed Mahameed <saeedm@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>
Subject: [kbuild] net/core/devlink.c:4415:9: warning: Identical condition 'err', second condition is always false
Date: Thu, 12 Nov 2020 14:00:11 +0300	[thread overview]
Message-ID: <20201112110011.GX18329@kadam> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   3d5e28bff7ad55aea081c1af516cc1c94a5eca7d
commit: 573ed90aa5e23b512168400ba6d65e592081944e devlink: Force enclosing array on binary fmsg data
compiler: riscv64-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)

>> net/core/devlink.c:4415:9: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit]
    return err;
           ^
   net/core/devlink.c:4411:6: note: first condition
    if (err)
        ^
   net/core/devlink.c:4415:9: note: second condition
    return err;
           ^

vim +/err +4415 net/core/devlink.c

573ed90aa5e23b Aya Levin       2020-02-11  4405  int devlink_fmsg_binary_pair_nest_start(struct devlink_fmsg *fmsg,
573ed90aa5e23b Aya Levin       2020-02-11  4406  					const char *name)
573ed90aa5e23b Aya Levin       2020-02-11  4407  {
573ed90aa5e23b Aya Levin       2020-02-11  4408  	int err;
573ed90aa5e23b Aya Levin       2020-02-11  4409  
573ed90aa5e23b Aya Levin       2020-02-11  4410  	err = devlink_fmsg_arr_pair_nest_start(fmsg, name);
573ed90aa5e23b Aya Levin       2020-02-11  4411  	if (err)
573ed90aa5e23b Aya Levin       2020-02-11  4412  		return err;
573ed90aa5e23b Aya Levin       2020-02-11  4413  
573ed90aa5e23b Aya Levin       2020-02-11  4414  	fmsg->putting_binary = true;
573ed90aa5e23b Aya Levin       2020-02-11 @4415  	return err;

Just "return 0;"

573ed90aa5e23b Aya Levin       2020-02-11  4416  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

                 reply	other threads:[~2020-11-12 11: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=20201112110011.GX18329@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=ayal@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=saeedm@mellanox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox