mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/cxl/core/features.c:441 cxlctl_validate_hw_command() warn: always true condition '(scope >= 0) => (0-u32max >= 0)'
@ 2025-04-04  2:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-04  2:25 UTC (permalink / raw)
  To: Dave Jiang
  Cc: oe-kbuild-all, linux-kernel, Jason Gunthorpe, Dan Williams,
	Jonathan Cameron, Li Ming

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06a22366d6a11ca8ed03c738171822ac9b714cfd
commit: 4d1c09cef2c244bd19467c016a3e56ba28ecc59d cxl: Add support for fwctl RPC command to enable CXL feature commands
date:   2 weeks ago
config: loongarch-randconfig-r071-20250404 (https://download.01.org/0day-ci/archive/20250404/202504041033.2HBboAZR-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.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/202504041033.2HBboAZR-lkp@intel.com/

smatch warnings:
drivers/cxl/core/features.c:441 cxlctl_validate_hw_command() warn: always true condition '(scope >= 0) => (0-u32max >= 0)'

vim +441 drivers/cxl/core/features.c

   429	
   430	static bool cxlctl_validate_hw_command(struct cxl_features_state *cxlfs,
   431					       const struct fwctl_rpc_cxl *rpc_in,
   432					       enum fwctl_rpc_scope scope,
   433					       u16 opcode)
   434	{
   435		struct cxl_mailbox *cxl_mbox = &cxlfs->cxlds->cxl_mbox;
   436	
   437		switch (opcode) {
   438		case CXL_MBOX_OP_GET_SUPPORTED_FEATURES:
   439			if (cxl_mbox->feat_cap < CXL_FEATURES_RO)
   440				return false;
 > 441			if (scope >= FWCTL_RPC_CONFIGURATION)
   442				return true;
   443			return false;
   444		default:
   445			return false;
   446		}
   447	}
   448	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-04  2:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-04  2:25 drivers/cxl/core/features.c:441 cxlctl_validate_hw_command() warn: always true condition '(scope >= 0) => (0-u32max >= 0)' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®