diff mbox series

[ndctl,2/3] cxl: region: remove redundant func name from error

Message ID 20230509152427.6920-3-minwoo.im.dev@gmail.com
State Accepted
Commit 37773b74afcb27056b7f1d74fdb4f661f91adee2
Headers show
Series cxl: clean up and fix typos | expand

Commit Message

Minwoo Im May 9, 2023, 3:24 p.m. UTC
If user does not provide `-s, --size` option and there's no ep_min_size
configured, it prints error log like the following.  This patch removes
redundant repeated function name from the log.

Before:

  root@vm:~/work# cxl create-region -m -d decoder0.0 -w 1 -g 1024 mem0
  cxl region: create_region: create_region: unable to determine region size
  cxl region: cmd_create_region: created 0 regions

After:
  root@vm:~/work# cxl create-region -m -d decoder0.0 -w 1 -g 1024 mem0
  cxl region: create_region: unable to determine region size
  cxl region: cmd_create_region: created 0 regions

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
 cxl/region.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Dave Jiang May 9, 2023, 5:32 p.m. UTC | #1
On 5/9/23 8:24 AM, Minwoo Im wrote:
> If user does not provide `-s, --size` option and there's no ep_min_size
> configured, it prints error log like the following.  This patch removes
> redundant repeated function name from the log.
> 
> Before:
> 
>    root@vm:~/work# cxl create-region -m -d decoder0.0 -w 1 -g 1024 mem0
>    cxl region: create_region: create_region: unable to determine region size
>    cxl region: cmd_create_region: created 0 regions
> 
> After:
>    root@vm:~/work# cxl create-region -m -d decoder0.0 -w 1 -g 1024 mem0
>    cxl region: create_region: unable to determine region size
>    cxl region: cmd_create_region: created 0 regions
> 
> Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   cxl/region.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/cxl/region.c b/cxl/region.c
> index 07ce4a319fd0..71f152d9e5a5 100644
> --- a/cxl/region.c
> +++ b/cxl/region.c
> @@ -607,7 +607,8 @@ static int create_region(struct cxl_ctx *ctx, int *count,
>   	} else if (p->ep_min_size) {
>   		size = p->ep_min_size * p->ways;
>   	} else {
> -		log_err(&rl, "%s: unable to determine region size\n", __func__);
> +		log_err(&rl, "unable to determine region size\n");
> +
>   		return -ENXIO;
>   	}
>   	max_extent = cxl_decoder_get_max_available_extent(p->root_decoder);
diff mbox series

Patch

diff --git a/cxl/region.c b/cxl/region.c
index 07ce4a319fd0..71f152d9e5a5 100644
--- a/cxl/region.c
+++ b/cxl/region.c
@@ -607,7 +607,8 @@  static int create_region(struct cxl_ctx *ctx, int *count,
 	} else if (p->ep_min_size) {
 		size = p->ep_min_size * p->ways;
 	} else {
-		log_err(&rl, "%s: unable to determine region size\n", __func__);
+		log_err(&rl, "unable to determine region size\n");
+
 		return -ENXIO;
 	}
 	max_extent = cxl_decoder_get_max_available_extent(p->root_decoder);