* [PATCH] mm: use __func__ replace function name
@ 2020-06-15 11:28 hui yang
2020-06-15 11:47 ` Matthew Wilcox
0 siblings, 1 reply; 2+ messages in thread
From: hui yang @ 2020-06-15 11:28 UTC (permalink / raw)
To: cl; +Cc: penberg, rientjes, linux-mm, iamjoonsoo.kim, YangHui
From: YangHui <yanghui.def@gmail.com>
it's much better to use __func__
Signed-off-by: YangHui <yanghui.def@gmail.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 9e72ba2..274b374 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -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:
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: use __func__ replace function name
2020-06-15 11:28 [PATCH] mm: use __func__ replace function name hui yang
@ 2020-06-15 11:47 ` Matthew Wilcox
0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2020-06-15 11:47 UTC (permalink / raw)
To: hui yang; +Cc: cl, penberg, rientjes, linux-mm, iamjoonsoo.kim
On Mon, Jun 15, 2020 at 07:28:54PM +0800, hui yang wrote:
> From: YangHui <yanghui.def@gmail.com>
>
> 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".
> @@ -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:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-15 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 11:28 [PATCH] mm: use __func__ replace function name hui yang
2020-06-15 11:47 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).