All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fan Ni <nifan.cxl@gmail.com>
To: Li Ming <ming.li@zohomail.com>
Cc: dave@stgolabs.net, jonathan.cameron@huawei.com,
	dave.jiang@intel.com, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	dan.j.williams@intel.com, linux-cxl@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] cxl/feature: Remove redundant code of get supported features
Date: Mon, 19 May 2025 15:08:32 -0700	[thread overview]
Message-ID: <aCur4HRH-WT2sj8t@lg> (raw)
In-Reply-To: <20250516143220.35302-1-ming.li@zohomail.com>

On Fri, May 16, 2025 at 10:32:20PM +0800, Li Ming wrote:
> In cxlctl_get_supported_features(), there is a code block that handles
> the case where the requested is equal to 0. But the code following the
> code block can also handle this situation. So the code block is not
> needed.
> 
> Signed-off-by: Li Ming <ming.li@zohomail.com>
> ---

Reviewed-by: Fan Ni <fan.ni@samsung.com>

> base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3 v6.15-rc6
> ---
>  drivers/cxl/core/features.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c
> index 1498e2369c37..2d3a6d36a761 100644
> --- a/drivers/cxl/core/features.c
> +++ b/drivers/cxl/core/features.c
> @@ -416,14 +416,6 @@ static void *cxlctl_get_supported_features(struct cxl_features_state *cxlfs,
>  
>  	rpc_out->size = struct_size(feat_out, ents, requested);
>  	feat_out = &rpc_out->get_sup_feats_out;
> -	if (requested == 0) {
> -		feat_out->num_entries = cpu_to_le16(requested);
> -		feat_out->supported_feats =
> -			cpu_to_le16(cxlfs->entries->num_features);
> -		rpc_out->retval = CXL_MBOX_CMD_RC_SUCCESS;
> -		*out_len = out_size;
> -		return no_free_ptr(rpc_out);
> -	}
>  
>  	for (i = start, pos = &feat_out->ents[0];
>  	     i < cxlfs->entries->num_features; i++, pos++) {
> -- 
> 2.34.1
> 

-- 
Fan Ni

      parent reply	other threads:[~2025-05-19 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 14:32 [PATCH 1/1] cxl/feature: Remove redundant code of get supported features Li Ming
2025-05-16 15:24 ` Dave Jiang
2025-05-19 15:33 ` Jonathan Cameron
2025-05-19 16:12 ` Dave Jiang
2025-05-19 22:08 ` Fan Ni [this message]

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=aCur4HRH-WT2sj8t@lg \
    --to=nifan.cxl@gmail.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=vishal.l.verma@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.