From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <dave@stgolabs.net>,
<alison.schofield@intel.com>, <ira.weiny@intel.com>,
<danj.williams@intel.com>, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] cxl: Remove always true condition for cxlctl_validate_hw_command()
Date: Fri, 4 Apr 2025 18:08:08 +0100 [thread overview]
Message-ID: <20250404180808.00004850@huawei.com> (raw)
In-Reply-To: <20250404165418.3032414-1-dave.jiang@intel.com>
On Fri, 4 Apr 2025 09:54:18 -0700
Dave Jiang <dave.jiang@intel.com> wrote:
> 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/
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/cxl/core/features.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c
> index caf92e9cea21..594f290042e9 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;
next prev parent reply other threads:[~2025-04-04 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 16:54 [PATCH] cxl: Remove always true condition for cxlctl_validate_hw_command() Dave Jiang
2025-04-04 17:08 ` Jonathan Cameron [this message]
2025-04-04 19:07 ` Ira Weiny
2025-04-07 6:11 ` Li Ming
2025-04-09 19:34 ` Dave Jiang
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=20250404180808.00004850@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=danj.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=lkp@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.