mm: use __func__ replace function name
Subsystems (2)
PATCH 1/1 mm: use __func__ replace function name
From: YangHui <[email protected]>
it's much better to use __func__
Signed-off-by YangHui <[email protected]>
--- mm/slab_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/slab_common.c +2 -2
@@ -960,8 +960,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:
Signature · 1 line
2.7.4
Quoted 3 lines · hui yang
From: YangHui <[email protected]>
it's much better to use
__func__
Not always. This message is reporting the improper usage of a public API. If we were to, for example, split the function into two and rename this half of it __kmem_cache_destroy(), we'd still want this message to say kmem_cache_destroy.
I don't think we should apply this change, and if you have similar patches in mind, I'd like to see a more detailed argument than "it's better".
Quoted 11 lines
mm/slab_common.c +2
-2@@ -960,8 +960,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: