linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Justin Stitt <justinstitt@google.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Kees Cook <keescook@chromium.org>, Hannes Reinecke <hare@suse.de>
Subject: [linux-next:master 7125/9096] drivers/scsi/fcoe/fcoe_sysfs.c:283 store_ctlr_mode() warn: unsigned 'ctlr->mode' is never less than zero.
Date: Wed, 20 Dec 2023 14:37:33 +0800	[thread overview]
Message-ID: <202312201409.y5nmYEx3-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   aa4db8324c4d0e67aa4670356df4e9fae14b4d37
commit: edc22a7c86888d1f2442e359c3b33a861045e9cd [7125/9096] scsi: fcoe: Use sysfs_match_string() over fcoe_parse_mode()
config: x86_64-randconfig-161-20231220 (https://download.01.org/0day-ci/archive/20231220/202312201409.y5nmYEx3-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312201409.y5nmYEx3-lkp@intel.com/

smatch warnings:
drivers/scsi/fcoe/fcoe_sysfs.c:283 store_ctlr_mode() warn: unsigned 'ctlr->mode' is never less than zero.

vim +283 drivers/scsi/fcoe/fcoe_sysfs.c

   260	
   261	static ssize_t store_ctlr_mode(struct device *dev,
   262				       struct device_attribute *attr,
   263				       const char *buf, size_t count)
   264	{
   265		struct fcoe_ctlr_device *ctlr = dev_to_ctlr(dev);
   266	
   267		if (count > FCOE_MAX_MODENAME_LEN)
   268			return -EINVAL;
   269	
   270	
   271		switch (ctlr->enabled) {
   272		case FCOE_CTLR_ENABLED:
   273			LIBFCOE_SYSFS_DBG(ctlr, "Cannot change mode when enabled.\n");
   274			return -EBUSY;
   275		case FCOE_CTLR_DISABLED:
   276			if (!ctlr->f->set_fcoe_ctlr_mode) {
   277				LIBFCOE_SYSFS_DBG(ctlr,
   278						  "Mode change not supported by LLD.\n");
   279				return -ENOTSUPP;
   280			}
   281	
   282			ctlr->mode = sysfs_match_string(fip_conn_type_names, buf);
 > 283			if (ctlr->mode < 0 || ctlr->mode == FIP_CONN_TYPE_UNKNOWN) {
   284				LIBFCOE_SYSFS_DBG(ctlr, "Unknown mode %s provided.\n",
   285						  buf);
   286				return -EINVAL;
   287			}
   288	
   289			ctlr->f->set_fcoe_ctlr_mode(ctlr);
   290			LIBFCOE_SYSFS_DBG(ctlr, "Mode changed to %s.\n", buf);
   291	
   292			return count;
   293		case FCOE_CTLR_UNUSED:
   294		default:
   295			LIBFCOE_SYSFS_DBG(ctlr, "Mode change not supported.\n");
   296			return -ENOTSUPP;
   297		}
   298	}
   299	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2023-12-20  6:37 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=202312201409.y5nmYEx3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hare@suse.de \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-mm@kvack.org \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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