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

Changes in v2
 - use %s replace function name for the panic() call
 - use %s replace function name:kmem_cache_destroy

gumingtao (1):
  slab: Use %s instead of function name

 mm/slab_common.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.7.4


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

* [PATCH v2] slab: Use %s instead of function name
  2021-06-21  2:40 [PATCH v2] slab: Use %s instead of function name gumingtao
@ 2021-06-21  2:40 ` gumingtao
  2021-06-22  9:20     ` David Laight
  0 siblings, 1 reply; 4+ messages in thread
From: gumingtao @ 2021-06-21  2:40 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 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/slab_common.c b/mm/slab_common.c
index a4a5714..ffa3b11 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -378,11 +378,11 @@ kmem_cache_create_usercopy(const char *name,
 
 	if (err) {
 		if (flags & SLAB_PANIC)
-			panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
-				name, err);
+			panic("%s: Failed to create slab '%s'. Error %d\n",
+				__func__, 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;
@@ -509,8 +509,8 @@ void kmem_cache_destroy(struct kmem_cache *s)
 
 	err = shutdown_cache(s);
 	if (err) {
-		pr_err("kmem_cache_destroy %s: Slab cache still has objects\n",
-		       s->name);
+		pr_err("%s %s: Slab cache still has objects\n",
+		       __func__, s->name);
 		dump_stack();
 	}
 out_unlock:
-- 
2.7.4


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

* RE: [PATCH v2] slab: Use %s instead of function name
  2021-06-21  2:40 ` gumingtao
@ 2021-06-22  9:20     ` David Laight
  0 siblings, 0 replies; 4+ messages in thread
From: David Laight @ 2021-06-22  9:20 UTC (permalink / raw)
  To: 'gumingtao', cl
  Cc: penberg, rientjes, iamjoonsoo.kim, akpm, vbabka, nathan,
	ndesaulniers, linux-mm, linux-kernel, clang-built-linux,
	gumingtao

From: gumingtao
> Sent: 21 June 2021 03:41
> 
> It is better to replace the function name with %s.

Should this (and the subject) be:

Use __func__ to trace function names.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* RE: [PATCH v2] slab: Use %s instead of function name
@ 2021-06-22  9:20     ` David Laight
  0 siblings, 0 replies; 4+ messages in thread
From: David Laight @ 2021-06-22  9:20 UTC (permalink / raw)
  To: 'gumingtao', cl
  Cc: penberg, rientjes, iamjoonsoo.kim, akpm, vbabka, nathan,
	ndesaulniers, linux-mm, linux-kernel, clang-built-linux,
	gumingtao

From: gumingtao
> Sent: 21 June 2021 03:41
> 
> It is better to replace the function name with %s.

Should this (and the subject) be:

Use __func__ to trace function names.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)



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

end of thread, other threads:[~2021-06-22  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  2:40 [PATCH v2] slab: Use %s instead of function name gumingtao
2021-06-21  2:40 ` gumingtao
2021-06-22  9:20   ` David Laight
2021-06-22  9:20     ` David Laight

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.