All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab: Use %s instead of function name
@ 2021-06-18 10:59 gumingtao
  2021-06-18 12:03   ` Lukas Bulwahn
  0 siblings, 1 reply; 5+ messages in thread
From: gumingtao @ 2021-06-18 10:59 UTC (permalink / raw)
  To: cl
  Cc: penberg, rientjes, iamjoonsoo.kim, akpm, vbabka, nathan,
	ndesaulniers, linux-mm, linux-kernel, clang-built-linux,
	gumingtao

It is better to replace the function name with %s.

Signed-off-by: gumingtao <gumingtao@xiaomi.com>
---
 mm/slab_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index a4a5714..36127dc 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -381,8 +381,8 @@ kmem_cache_create_usercopy(const char *name,
 			panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
 				name, err);
 		else {
-			pr_warn("kmem_cache_create(%s) failed with error %d\n",
-				name, err);
+			pr_warn("%s(%s) failed with error %d\n",
+				__func__, name, err);
 			dump_stack();
 		}
 		return NULL;
-- 
2.7.4


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

* Re: [PATCH] slab: Use %s instead of function name
  2021-06-18 10:59 [PATCH] slab: Use %s instead of function name gumingtao
@ 2021-06-18 12:03   ` Lukas Bulwahn
  0 siblings, 0 replies; 5+ messages in thread
From: Lukas Bulwahn @ 2021-06-18 12:03 UTC (permalink / raw)
  To: gumingtao
  Cc: cl, penberg, rientjes, iamjoonsoo.kim, Andrew Morton,
	Vlastimil Babka, Nathan Chancellor, Nick Desaulniers, Linux-MM,
	Linux Kernel Mailing List, clang-built-linux, gumingtao

On Fri, Jun 18, 2021 at 12:59 PM gumingtao <gumingtao1225@gmail.com> wrote:
>
> It is better to replace the function name with %s.
>
> Signed-off-by: gumingtao <gumingtao@xiaomi.com>
> ---
>  mm/slab_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index a4a5714..36127dc 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -381,8 +381,8 @@ kmem_cache_create_usercopy(const char *name,
>                         panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",

I am just wondering:

Can you also make that refactoring change for the panic() call as well?

How about checking the whole file for such patterns and doing that
change for all occurrences?


>                                 name, err);
>                 else {
> -                       pr_warn("kmem_cache_create(%s) failed with error %d\n",
> -                               name, err);
> +                       pr_warn("%s(%s) failed with error %d\n",
> +                               __func__, name, err);
>                         dump_stack();
>                 }
>                 return NULL;
> --
> 2.7.4
>

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

* Re: [PATCH] slab: Use %s instead of function name
@ 2021-06-18 12:03   ` Lukas Bulwahn
  0 siblings, 0 replies; 5+ messages in thread
From: Lukas Bulwahn @ 2021-06-18 12:03 UTC (permalink / raw)
  To: gumingtao
  Cc: cl, penberg, rientjes, iamjoonsoo.kim, Andrew Morton,
	Vlastimil Babka, Nathan Chancellor, Nick Desaulniers, Linux-MM,
	Linux Kernel Mailing List, clang-built-linux, gumingtao

On Fri, Jun 18, 2021 at 12:59 PM gumingtao <gumingtao1225@gmail.com> wrote:
>
> It is better to replace the function name with %s.
>
> Signed-off-by: gumingtao <gumingtao@xiaomi.com>
> ---
>  mm/slab_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index a4a5714..36127dc 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -381,8 +381,8 @@ kmem_cache_create_usercopy(const char *name,
>                         panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",

I am just wondering:

Can you also make that refactoring change for the panic() call as well?

How about checking the whole file for such patterns and doing that
change for all occurrences?


>                                 name, err);
>                 else {
> -                       pr_warn("kmem_cache_create(%s) failed with error %d\n",
> -                               name, err);
> +                       pr_warn("%s(%s) failed with error %d\n",
> +                               __func__, name, err);
>                         dump_stack();
>                 }
>                 return NULL;
> --
> 2.7.4
>


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

* Re: [PATCH] slab: Use %s instead of function name
  2021-06-18 12:03   ` Lukas Bulwahn
@ 2021-06-18 19:32     ` David Rientjes
  -1 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2021-06-18 19:32 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: gumingtao, cl, penberg, iamjoonsoo.kim, Andrew Morton,
	Vlastimil Babka, Nathan Chancellor, Nick Desaulniers, Linux-MM,
	Linux Kernel Mailing List, clang-built-linux, gumingtao

On Fri, 18 Jun 2021, Lukas Bulwahn wrote:

> > It is better to replace the function name with %s.
> >
> > Signed-off-by: gumingtao <gumingtao@xiaomi.com>
> > ---
> >  mm/slab_common.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index a4a5714..36127dc 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -381,8 +381,8 @@ kmem_cache_create_usercopy(const char *name,
> >                         panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
> 
> I am just wondering:
> 
> Can you also make that refactoring change for the panic() call as well?
> 
> How about checking the whole file for such patterns and doing that
> change for all occurrences?
> 

Yeah, that would be ideal if gumingtao is willing to do it.  These are 
some instances where the function name actually mismatches.  gumingtao, 
would you be willing to do this?

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

* Re: [PATCH] slab: Use %s instead of function name
@ 2021-06-18 19:32     ` David Rientjes
  0 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2021-06-18 19:32 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: gumingtao, cl, penberg, iamjoonsoo.kim, Andrew Morton,
	Vlastimil Babka, Nathan Chancellor, Nick Desaulniers, Linux-MM,
	Linux Kernel Mailing List, clang-built-linux, gumingtao

On Fri, 18 Jun 2021, Lukas Bulwahn wrote:

> > It is better to replace the function name with %s.
> >
> > Signed-off-by: gumingtao <gumingtao@xiaomi.com>
> > ---
> >  mm/slab_common.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index a4a5714..36127dc 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -381,8 +381,8 @@ kmem_cache_create_usercopy(const char *name,
> >                         panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
> 
> I am just wondering:
> 
> Can you also make that refactoring change for the panic() call as well?
> 
> How about checking the whole file for such patterns and doing that
> change for all occurrences?
> 

Yeah, that would be ideal if gumingtao is willing to do it.  These are 
some instances where the function name actually mismatches.  gumingtao, 
would you be willing to do this?


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

end of thread, other threads:[~2021-06-18 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 10:59 [PATCH] slab: Use %s instead of function name gumingtao
2021-06-18 12:03 ` Lukas Bulwahn
2021-06-18 12:03   ` Lukas Bulwahn
2021-06-18 19:32   ` David Rientjes
2021-06-18 19:32     ` David Rientjes

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.