public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jessica Yu <jeyu@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Matthias Maennich <maennich@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] modpost: rework and consolidate logging interface
Date: Mon, 9 Mar 2020 10:59:14 +0100	[thread overview]
Message-ID: <20200309095914.GA18870@linux-8ccs.fritz.box> (raw)
In-Reply-To: <CAK7LNARZ4VgaCa_TiDBG-99amBGTTXTQMs9LsK3nO4k+y-5KDQ@mail.gmail.com>

+++ Masahiro Yamada [09/03/20 09:40 +0900]:
>Hi Jessica,
>
>
>
>On Sat, Mar 7, 2020 at 1:02 AM Jessica Yu <jeyu@kernel.org> wrote:
>>
>> Rework modpost's logging interface by consolidating merror(), warn(), and
>> fatal() to use a single function, modpost_log(). Introduce different
>> logging levels (WARN, ERROR, FATAL) as well. The purpose of this cleanup is
>> to reduce code duplication when deciding whether or not to warn or error
>> out based on a condition.
>>
>> Signed-off-by: Jessica Yu <jeyu@kernel.org>
>> ---
>> v3:
>>         - remove level variable from modpost_log and just call fprintf in each
>>           case
>>         - remove warn_unless and just call modpost_log() directly
>>         - fix checkpatch error:
>>                 ERROR: space required before the open parenthesis '('
>>         #102: FILE: scripts/mod/modpost.c:61:
>>         + switch(loglevel) {
>>
>>  scripts/mod/modpost.c | 68 ++++++++++++++++++++++-----------------------------
>>  scripts/mod/modpost.h | 14 ++++++++---
>>  2 files changed, 40 insertions(+), 42 deletions(-)
>>
>> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
>> index 7edfdb2f4497..a2329235a6db 100644
>> --- a/scripts/mod/modpost.c
>> +++ b/scripts/mod/modpost.c
>> @@ -51,41 +51,34 @@ enum export {
>>
>>  #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
>>
>> -#define PRINTF __attribute__ ((format (printf, 1, 2)))
>> +#define PRINTF __attribute__ ((format (printf, 2, 3)))
>>
>> -PRINTF void fatal(const char *fmt, ...)
>> +PRINTF void modpost_log(enum loglevel loglevel, const char *fmt, ...)
>>  {
>
>
>This series looks good to me.
>
>I can queue it up to kbuild tree
>if there is no objection.
>
>
>I just noticed one nit.
>
>Now that modpost_log() is the only user of PRINTF,
>we can delete PRITNF, and directly add the attribute
>to modpost_log(), like this:
>
>
>void __attribute__((format(printf, 2, 3)))
>modpost_log(enum loglevel loglevel, const char *fmt, ...)
>{
>       ...
>}
>
>
>If you agree, I can modify it when I apply it.

Yes, I agree with this change. Thank you!

One more thing, it's not immediately obvious to me why the first patch
would cause those kbuild warnings :-/ I'll see if I have any luck
reproducing them locally..

Thanks,

Jessica


  reply	other threads:[~2020-03-09  9:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 16:02 [PATCH v3 1/2] modpost: rework and consolidate logging interface Jessica Yu
2020-03-06 16:02 ` [PATCH v3 2/2] modpost: return error if module is missing ns imports and MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=n Jessica Yu
2020-03-09  0:40 ` [PATCH v3 1/2] modpost: rework and consolidate logging interface Masahiro Yamada
2020-03-09  9:59   ` Jessica Yu [this message]
2020-03-09 10:20     ` Masahiro Yamada
2020-03-09 10:39       ` Jessica Yu
2020-03-09 10:49         ` Masahiro Yamada
2020-03-09 10:58           ` Jessica Yu
2020-03-09 11:03             ` Masahiro Yamada
2020-03-10 11:32               ` Jessica Yu
2020-03-10 15:55                 ` [LKP] " Philip Li
2020-03-11  1:00                   ` Masahiro Yamada
2020-03-11 12:26                     ` Philip Li
2020-03-12  0:50                     ` Rong Chen
2020-03-11  0:56                 ` Masahiro Yamada

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=20200309095914.GA18870@linux-8ccs.fritz.box \
    --to=jeyu@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maennich@google.com \
    --cc=masahiroy@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox