Skip to content

Commit cdafa67

Browse files
committed
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>
1 parent b443265 commit cdafa67

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/cxl/core/features.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,7 @@ static bool cxlctl_validate_hw_command(struct cxl_features_state *cxlfs,
614614
switch (opcode) {
615615
case CXL_MBOX_OP_GET_SUPPORTED_FEATURES:
616616
case CXL_MBOX_OP_GET_FEATURE:
617-
if (cxl_mbox->feat_cap < CXL_FEATURES_RO)
618-
return false;
619-
if (scope >= FWCTL_RPC_CONFIGURATION)
620-
return true;
621-
return false;
617+
return cxl_mbox->feat_cap >= CXL_FEATURES_RO;
622618
case CXL_MBOX_OP_SET_FEATURE:
623619
if (cxl_mbox->feat_cap < CXL_FEATURES_RW)
624620
return false;

0 commit comments

Comments
 (0)