public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl/acpi: Fix coding style issues in acpi.c
@ 2026-03-17 12:13 Teshan Kannangara
  2026-03-17 14:48 ` Dave Jiang
  0 siblings, 1 reply; 3+ messages in thread
From: Teshan Kannangara @ 2026-03-17 12:13 UTC (permalink / raw)
  To: dave
  Cc: jonathan.cameron, dave.jiang, alison.schofield, vishal.l.verma,
	ira.weiny, dan.j.williams, linux-cxl, linux-kernel

Fix various coding style issues in drivers/cxl/acpi.c, including
indentation, line wrapping, macro alignment, cast formatting,
and conditional braces.

No functional changes.

Signed-off-by: Teshan Kannangara <tpk.teshan@gmail.com>
---
 drivers/cxl/acpi.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 127537628817..b54b962cf973 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -395,9 +395,16 @@ static void cxl_setup_extended_linear_cache(struct cxl_root_decoder *cxlrd)
 	cxlrd->cache_size = cache_size;
 }
 
-DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
-	    if (!IS_ERR_OR_NULL(_T)) put_device(&_T->cxlsd.cxld.dev))
-DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T))
+DEFINE_FREE
+(put_cxlrd, struct cxl_root_decoder *,
+if (!IS_ERR_OR_NULL(_T))
+	put_device(&_T->cxlsd.cxld.dev))
+
+DEFINE_FREE
+(del_cxl_resource, struct resource *,
+if (_T)
+	del_cxl_resource(_T))
+
 static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
 			     struct cxl_cfmws_context *ctx)
 {
@@ -419,8 +426,8 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
 	if (rc)
 		return rc;
 
-	struct resource *res __free(del_cxl_resource) = alloc_cxl_resource(
-		cfmws->base_hpa, cfmws->window_size, ctx->id++);
+	struct resource *res __free(del_cxl_resource) =
+		alloc_cxl_resource(cfmws->base_hpa, cfmws->window_size, ctx->id++);
 	if (!res)
 		return -ENOMEM;
 
@@ -542,7 +549,7 @@ static int cxl_get_chbs_iter(union acpi_subtable_headers *header, void *arg,
 	struct cxl_chbs_context *ctx = arg;
 	struct acpi_cedt_chbs *chbs;
 
-	chbs = (struct acpi_cedt_chbs *) header;
+	chbs = (struct acpi_cedt_chbs *)header;
 
 	if (chbs->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11 &&
 	    chbs->length != ACPI_CEDT_CHBS_LENGTH_CXL11)
@@ -774,12 +781,12 @@ static void cxl_acpi_lock_reset_class(void *dev)
 
 static void cxl_set_public_resource(struct resource *priv, struct resource *pub)
 {
-	priv->desc = (unsigned long) pub;
+	priv->desc = (unsigned long)pub;
 }
 
 static struct resource *cxl_get_public_resource(struct resource *priv)
 {
-	return (struct resource *) priv->desc;
+	return (struct resource *)(priv->desc);
 }
 
 static void remove_cxl_resources(void *data)
@@ -850,8 +857,9 @@ static int add_cxl_resources(struct resource *cxl_res)
 				remove_resource(next);
 				del_cxl_resource(next);
 				next = _next;
-			} else
+			} else {
 				next->start = new->end + 1;
+			}
 		}
 	}
 	return 0;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cxl/acpi: Fix coding style issues in acpi.c
  2026-03-17 12:13 [PATCH] cxl/acpi: Fix coding style issues in acpi.c Teshan Kannangara
@ 2026-03-17 14:48 ` Dave Jiang
  2026-03-17 17:59   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jiang @ 2026-03-17 14:48 UTC (permalink / raw)
  To: Teshan Kannangara, dave
  Cc: jonathan.cameron, alison.schofield, vishal.l.verma, ira.weiny,
	dan.j.williams, linux-cxl, linux-kernel



On 3/17/26 5:13 AM, Teshan Kannangara wrote:
> Fix various coding style issues in drivers/cxl/acpi.c, including
> indentation, line wrapping, macro alignment, cast formatting,
> and conditional braces.

Hi Teshan,
Thank you for the code changes. While we appreciate it, I'm going to NAK the changes. For this sub-system, we are not going to make style changes or fixes unless it's part of functional code changes or refactor. The reason is to not introduce unnecessary churns to the code that can make fix backports difficult later on. Thanks.

DJ

> 
> No functional changes.
> 
> Signed-off-by: Teshan Kannangara <tpk.teshan@gmail.com>
> ---
>  drivers/cxl/acpi.c | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index 127537628817..b54b962cf973 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -395,9 +395,16 @@ static void cxl_setup_extended_linear_cache(struct cxl_root_decoder *cxlrd)
>  	cxlrd->cache_size = cache_size;
>  }
>  
> -DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
> -	    if (!IS_ERR_OR_NULL(_T)) put_device(&_T->cxlsd.cxld.dev))
> -DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T))
> +DEFINE_FREE
> +(put_cxlrd, struct cxl_root_decoder *,
> +if (!IS_ERR_OR_NULL(_T))
> +	put_device(&_T->cxlsd.cxld.dev))
> +
> +DEFINE_FREE
> +(del_cxl_resource, struct resource *,
> +if (_T)
> +	del_cxl_resource(_T))
> +
>  static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
>  			     struct cxl_cfmws_context *ctx)
>  {
> @@ -419,8 +426,8 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
>  	if (rc)
>  		return rc;
>  
> -	struct resource *res __free(del_cxl_resource) = alloc_cxl_resource(
> -		cfmws->base_hpa, cfmws->window_size, ctx->id++);
> +	struct resource *res __free(del_cxl_resource) =
> +		alloc_cxl_resource(cfmws->base_hpa, cfmws->window_size, ctx->id++);
>  	if (!res)
>  		return -ENOMEM;
>  
> @@ -542,7 +549,7 @@ static int cxl_get_chbs_iter(union acpi_subtable_headers *header, void *arg,
>  	struct cxl_chbs_context *ctx = arg;
>  	struct acpi_cedt_chbs *chbs;
>  
> -	chbs = (struct acpi_cedt_chbs *) header;
> +	chbs = (struct acpi_cedt_chbs *)header;
>  
>  	if (chbs->cxl_version == ACPI_CEDT_CHBS_VERSION_CXL11 &&
>  	    chbs->length != ACPI_CEDT_CHBS_LENGTH_CXL11)
> @@ -774,12 +781,12 @@ static void cxl_acpi_lock_reset_class(void *dev)
>  
>  static void cxl_set_public_resource(struct resource *priv, struct resource *pub)
>  {
> -	priv->desc = (unsigned long) pub;
> +	priv->desc = (unsigned long)pub;
>  }
>  
>  static struct resource *cxl_get_public_resource(struct resource *priv)
>  {
> -	return (struct resource *) priv->desc;
> +	return (struct resource *)(priv->desc);
>  }
>  
>  static void remove_cxl_resources(void *data)
> @@ -850,8 +857,9 @@ static int add_cxl_resources(struct resource *cxl_res)
>  				remove_resource(next);
>  				del_cxl_resource(next);
>  				next = _next;
> -			} else
> +			} else {
>  				next->start = new->end + 1;
> +			}
>  		}
>  	}
>  	return 0;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cxl/acpi: Fix coding style issues in acpi.c
  2026-03-17 14:48 ` Dave Jiang
@ 2026-03-17 17:59   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-03-17 17:59 UTC (permalink / raw)
  To: Dave Jiang
  Cc: Teshan Kannangara, dave, alison.schofield, vishal.l.verma,
	ira.weiny, dan.j.williams, linux-cxl, linux-kernel

On Tue, 17 Mar 2026 07:48:17 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> On 3/17/26 5:13 AM, Teshan Kannangara wrote:
> > Fix various coding style issues in drivers/cxl/acpi.c, including
> > indentation, line wrapping, macro alignment, cast formatting,
> > and conditional braces.  
> 
> Hi Teshan,
> Thank you for the code changes. While we appreciate it, I'm going to NAK the changes. For this sub-system, we are not going to make style changes or fixes unless it's part of functional code changes or refactor. The reason is to not introduce unnecessary churns to the code that can make fix backports difficult later on. Thanks.
> 
> DJ

I'm going to give it a quick review on the first item at least.

> 
> > 
> > No functional changes.
> > 
> > Signed-off-by: Teshan Kannangara <tpk.teshan@gmail.com>
> > ---
> >  drivers/cxl/acpi.c | 26 +++++++++++++++++---------
> >  1 file changed, 17 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> > index 127537628817..b54b962cf973 100644
> > --- a/drivers/cxl/acpi.c
> > +++ b/drivers/cxl/acpi.c
> > @@ -395,9 +395,16 @@ static void cxl_setup_extended_linear_cache(struct cxl_root_decoder *cxlrd)
> >  	cxlrd->cache_size = cache_size;
> >  }
> >  
> > -DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
> > -	    if (!IS_ERR_OR_NULL(_T)) put_device(&_T->cxlsd.cxld.dev))
> > -DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T))
> > +DEFINE_FREE
> > +(put_cxlrd, struct cxl_root_decoder *,
> > +if (!IS_ERR_OR_NULL(_T))
> > +	put_device(&_T->cxlsd.cxld.dev))
> > +
> > +DEFINE_FREE
> > +(del_cxl_resource, struct resource *,
> > +if (_T)
> > +	del_cxl_resource(_T))
> > +
Why? the original code was the standard way to format these and
there is no explanation of the change in the commit message.
Is it because it's over 80 chars long?  That is guidance only and
if readability is hurt (like here) feel free to go up to 100 chars
before worrying about it.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-17 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 12:13 [PATCH] cxl/acpi: Fix coding style issues in acpi.c Teshan Kannangara
2026-03-17 14:48 ` Dave Jiang
2026-03-17 17:59   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox