diff options
author | Dave Jiang <dave.jiang@intel.com> | 2025-04-04 09:54:18 -0700 |
---|---|---|
committer | Dave Jiang <dave.jiang@intel.com> | 2025-04-28 08:48:30 -0700 |
commit | cdafa67c0270116b0f4cdbd00b6170eb9aa92edf (patch) | |
tree | 33eba1adde4e6e77cfc27b2aec7fc70a4e5b8669 /drivers/cxl/core/features.c | |
parent | b4432656b36e5cc1d50a1f2dc15357543add530e (diff) |
cxl: Remove always true condition for cxlctl_validate_hw_command()
smatch warnings:
drivers/cxl/core/features.c:441 cxlctl_validate_hw_command() warn: always true condition '(scope >= 0) => (0-u32max >= 0)'
Remove the check entirely as it has no effect. Expectation is both of these
operations should be allowed for all check levels. They are read only and
have no change effects.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504041033.2HBboAZR-lkp@intel.com/
Reviewed-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://patch.msgid.link/20250404165418.3032414-1-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'drivers/cxl/core/features.c')
-rw-r--r-- | drivers/cxl/core/features.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c index 1498e2369c37..bdc2c492bdff 100644 --- a/drivers/cxl/core/features.c +++ b/drivers/cxl/core/features.c @@ -614,11 +614,7 @@ static bool cxlctl_validate_hw_command(struct cxl_features_state *cxlfs, switch (opcode) { case CXL_MBOX_OP_GET_SUPPORTED_FEATURES: case CXL_MBOX_OP_GET_FEATURE: - if (cxl_mbox->feat_cap < CXL_FEATURES_RO) - return false; - if (scope >= FWCTL_RPC_CONFIGURATION) - return true; - return false; + return cxl_mbox->feat_cap >= CXL_FEATURES_RO; case CXL_MBOX_OP_SET_FEATURE: if (cxl_mbox->feat_cap < CXL_FEATURES_RW) return false; |