From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2EE1C4727F for ; Thu, 24 Sep 2020 18:13:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46661208E4 for ; Thu, 24 Sep 2020 18:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728715AbgIXSNj (ORCPT ); Thu, 24 Sep 2020 14:13:39 -0400 Received: from mga12.intel.com ([192.55.52.136]:7229 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbgIXSNi (ORCPT ); Thu, 24 Sep 2020 14:13:38 -0400 IronPort-SDR: a/djZr5ntzpdlnZaZ8kkF6kQAu6xfgk7P0F+ha+Kq/ZVkN1a4kGJ+z7fcVoKSN+pjnNWn4jSJS /tykWhHFu1Gw== X-IronPort-AV: E=McAfee;i="6000,8403,9754"; a="140732721" X-IronPort-AV: E=Sophos;i="5.77,298,1596524400"; d="scan'208";a="140732721" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 11:13:38 -0700 IronPort-SDR: fQ9Tzp6ZRlcYFB2KRWD+hrbPicg63xexfZDY9TywMs7EyZYknrFoEklc6Wf1tjfflX17drqm9E l1Kk1E9OFesg== X-IronPort-AV: E=Sophos;i="5.77,298,1596524400"; d="scan'208";a="291322958" Received: from vanidesa-mobl.amr.corp.intel.com (HELO [10.209.65.234]) ([10.209.65.234]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 11:13:36 -0700 Subject: Re: [PATCH] modpost: allow modpost to fail on warnings To: Masahiro Yamada Cc: Linux Kernel Mailing List , Linux Kbuild mailing list , Kai Vehmanen , Filipe Brandenburger , Greg Thelen , Michael Davidson , Eugene Surovegin , Stephen Rothwell , Michal Marek , Jonathan Corbet , "open list:DOCUMENTATION" References: <20200918215010.250580-1-pierre-louis.bossart@linux.intel.com> From: Pierre-Louis Bossart Message-ID: Date: Thu, 24 Sep 2020 13:13:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> I think [1] should be an error instead of a warning >>> by default. >> >> would the following patch be what you have in mind? > > > No. > error() does not exist. > > merror() exists, but the difference from warn() > is just a prefix. > > If any error happens, modpost should return the error code. Sorry, I am not able to understand your recommendation. Existing code which calls merror() does not exit with an error code, e.g. static void sym_update_namespace(const char *symname, const char *namespace) { struct symbol *s = find_symbol(symname); /* * That symbol should have been created earlier and thus this is * actually an assertion. */ if (!s) { merror("Could not update namespace(%s) for symbol %s\n", namespace, symname); return; } What would be suggestion be then in this case? change all functions to return -EINVAL after each use of merror() or something? Or just add an exit(1) after all uses of merror()? >> If yes, also wondering if we can still add the option to treat warnings >> as errors as an opt-in behavior? > > > I want to add a new option only when it is necessary to do so. > > I am not sure which warnings are real warnings. That was the point of the suggested option, treat all warnings as errors and ignore the warning if it's no big deal. it's standard with gcc -Werror, it's be good to extend this to modpost - or what would be the drawback of doing so?