Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2291541ybh; Mon, 9 Mar 2020 02:59:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsWLv1sEmss86LE+kMY9jFVNLFBqWY8ovXEHka9Py0IxjnQNKWiMBwpbNKahVxMks8xMa0f X-Received: by 2002:aca:5546:: with SMTP id j67mr2518263oib.0.1583747993542; Mon, 09 Mar 2020 02:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583747993; cv=none; d=google.com; s=arc-20160816; b=pskA+6vNyBassChWzIaq0/v5e37nUsoQsHfvXF5w3tO+K8LZLSxOyMv6vGby7PWTBG O2MLhECtvMyBbHBcYCRQelkUw+XNUqlwp79npGPhiMXZafFq4ic4KjY5aQozasDQtC2A tqo4tOSckYvUdS2JlIeXetMN12ZiU/1w9ROUTnP9RP52Mp02guDQ+8sixLTauZzZezF1 E1r5h3sxKmL8bTDVZAPZqG25dfKn9Nmb+dg6mgAWZLFuGsXnGUAyBGCr46YXEh6/hAVc BNd45OmvxnD5LnWfj46UxN4DOqL8/NO5wAVUtIj36rhLVpRt77YBhFKM1+J864RuR3kx OX3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JuMZ20rVeWEzU5GHU0iqyZO0O4ozPuJl0NZAnuu6dIw=; b=g0uUEMMKj/cNJirqgQ2r0L6yJ+yFvQSA7aKWxlsxhW4N0rZQftZbsGC1jA9AjVjwRM jw0NEgUsTnN3wOmvTDldnmDbGpXA2cwYY7VEm4XFHMGVBgk97VnktvEg330u6Lg3dsLu 6dFRBJPq0gyivT43x8t6t5CIKUbLhUHbAo3SxwDfI9np+0rquJuuo/rqGIhsaYa5LwRC /86caMLADVL/sn6uWWeegJ3AgLPXLKQMRc+WMkkQlbchGsvo3Zw5kAgCn/iLMD9D8oML L6PMfQHrQhHs92GTClMmHuUDwIjaJ6d1qY0NQ0CbdH8j6Mk9en2/mJQSBg+cNOwymswF oplQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OUOHarpJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g35si5877724otg.32.2020.03.09.02.59.41; Mon, 09 Mar 2020 02:59:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OUOHarpJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbgCIJ7T (ORCPT + 99 others); Mon, 9 Mar 2020 05:59:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:34036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgCIJ7T (ORCPT ); Mon, 9 Mar 2020 05:59:19 -0400 Received: from linux-8ccs.fritz.box (p5B2812F9.dip0.t-ipconnect.de [91.40.18.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F53520828; Mon, 9 Mar 2020 09:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583747958; bh=0sP2HCSbp1hFImJrXuJEJrwE1KAk2T96fyJpUDGb184=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OUOHarpJ+5l89Tl4H9ZQXsnTA9Cq9db0NMUv+pLczhyDmAQYbCHG7gQ7XMjDnOv00 rUn4p/fprUebD3XQEH3j0o9636RzTEF5MKGI4NBOq/ApZfYIfepJ/5ENlTHVWjieQx 6agd6fm4ZcO++X+FNseKsoVxjpN1ukLKeY0rKoes= Date: Mon, 9 Mar 2020 10:59:14 +0100 From: Jessica Yu To: Masahiro Yamada Cc: Matthias Maennich , Linux Kernel Mailing List Subject: Re: [PATCH v3 1/2] modpost: rework and consolidate logging interface Message-ID: <20200309095914.GA18870@linux-8ccs.fritz.box> References: <20200306160206.5609-1-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 5.5.0-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Masahiro Yamada [09/03/20 09:40 +0900]: >Hi Jessica, > > > >On Sat, Mar 7, 2020 at 1:02 AM Jessica Yu 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 >> --- >> 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