public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Hans Zhang <18255117159@163.com>,
	dave@stgolabs.net, jic23@kernel.org, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com, djbw@kernel.org
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cxl/core: Use FIELD_MODIFY()
Date: Thu, 30 Apr 2026 13:21:04 -0700	[thread overview]
Message-ID: <6bc8cd86-e37e-4742-994c-6781e8f4ce50@intel.com> (raw)
In-Reply-To: <20260430162718.43536-1-18255117159@163.com>



On 4/30/26 9:27 AM, Hans Zhang wrote:
> Use FIELD_MODIFY() to remove open-coded bit manipulation.
> No functional change intended.
> 
> Signed-off-by: Hans Zhang <18255117159@163.com>

Hi Hans. Thank you for the submission. For the CXL sub-system, we basically have agreed that we will only take cleanups if there are additional work in the area in order to avoid excessive churn in the code for ease of maintenance and debugging (i.e. git bisect). Appreciate the work though.

DJ
 
> ---
>  drivers/cxl/core/edac.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cxl/core/edac.c b/drivers/cxl/core/edac.c
> index b321971fef58..a374e8ebac87 100644
> --- a/drivers/cxl/core/edac.c
> +++ b/drivers/cxl/core/edac.c
> @@ -717,8 +717,7 @@ static int cxl_set_ecs_count_mode(struct device *dev, u8 *log_cap, u16 *config,
>  		return -EINVAL;
>  	}
>  
> -	*config &= ~CXL_ECS_COUNT_MODE_MASK;
> -	*config |= FIELD_PREP(CXL_ECS_COUNT_MODE_MASK, val);
> +	FIELD_MODIFY(CXL_ECS_COUNT_MODE_MASK, config, val);
>  
>  	return 0;
>  }
> @@ -729,8 +728,7 @@ static int cxl_set_ecs_reset_counter(struct device *dev, u8 *log_cap,
>  	if (val != CXL_ECS_RESET_COUNTER)
>  		return -EINVAL;
>  
> -	*config &= ~CXL_ECS_RESET_COUNTER_MASK;
> -	*config |= FIELD_PREP(CXL_ECS_RESET_COUNTER_MASK, val);
> +	FIELD_MODIFY(CXL_ECS_RESET_COUNTER_MASK, config, val);
>  
>  	return 0;
>  }
> 
> base-commit: 3b3bea6d4b9c162f9e555905d96b8c1da67ecd5b


  reply	other threads:[~2026-04-30 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 16:27 [PATCH] cxl/core: Use FIELD_MODIFY() Hans Zhang
2026-04-30 20:21 ` Dave Jiang [this message]
2026-05-01 14:21   ` Hans Zhang

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=6bc8cd86-e37e-4742-994c-6781e8f4ce50@intel.com \
    --to=dave.jiang@intel.com \
    --cc=18255117159@163.com \
    --cc=alison.schofield@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=ira.weiny@intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox