All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: gumingtao <gumingtao1225@gmail.com>
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linux-MM <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	gumingtao <gumingtao@xiaomi.com>
Subject: Re: [PATCH] slab: Use %s instead of function name
Date: Fri, 18 Jun 2021 14:03:04 +0200	[thread overview]
Message-ID: <CAKXUXMxyDaEnWeGNZpCmAFG-5OG0JVrHz0RPk18n_z+ZDKQ-cQ@mail.gmail.com> (raw)
In-Reply-To: <1624013943-13935-1-git-send-email-gumingtao@xiaomi.com>

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
>

  reply	other threads:[~2021-06-18 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 10:59 [PATCH] slab: Use %s instead of function name gumingtao
2021-06-18 12:03 ` Lukas Bulwahn [this message]
2021-06-18 12:03   ` Lukas Bulwahn
2021-06-18 19:32   ` David Rientjes
2021-06-18 19:32     ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKXUXMxyDaEnWeGNZpCmAFG-5OG0JVrHz0RPk18n_z+ZDKQ-cQ@mail.gmail.com \
    --to=lukas.bulwahn@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=gumingtao1225@gmail.com \
    --cc=gumingtao@xiaomi.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.