From patchwork Sun May 24 15:42:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11567453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A7C1913 for ; Sun, 24 May 2020 15:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77D77207CB for ; Sun, 24 May 2020 15:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590335041; bh=luGqgXoz+9aXSGUcehDez2W+/tGohLA4JkXsAw2HaEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yHG2/mjm7q2tXQ/3BVRaQrku+SCUus7YWlqqlF7mS9hIKoPCMnS8Mhr+N7eLK9OC+ R+GfpPoRANYXIUam3r3I/JLMfx37+Z5yUFW30QqdUrnPB2g87zaCpLn4m4kVUB554m ksROfTYgb1CJLdbUEWQiYY37dxoPb4XZUTdA1YU0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387594AbgEXPnp (ORCPT ); Sun, 24 May 2020 11:43:45 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:19711 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728551AbgEXPnY (ORCPT ); Sun, 24 May 2020 11:43:24 -0400 Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-09.nifty.com with ESMTP id 04OFgcV8017561; Mon, 25 May 2020 00:42:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 04OFgcV8017561 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1590334971; bh=qzT9+tolI6nR6eDZTwWqFMLcC8eYszA2DAKwYhqQWRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NId0ZJySIg0JjB4k634jpPF3/WdzFtT1Q3hBlQACpf0tBECbZv17bG5drmRP7sGuS sBx+ec1eHjaIYz/RlYhgFhIlAKpLp/p2rxNoYiKHETxRbei9GnSH9V1e4UIA0pYpj2 E2vmak2C+yQkkkot3xygBlNU6me94jLGbQqga7vOwG2MTm4ftkZhIwV2WuwM84LHlz /h9rzqOqaHMFdv0xE4DqwwNa9gDBZQNo3CkXsTFjPHYfgO3HodkXXl4skQvaSrXOoE F+rs8zjICWTRqRBdHSLMOa3oHx9RlzarJYDLj6Ncv9bUXih4RZaEwpi7yhh1lJPUF5 1FJur30pCSQxw== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 23/29] modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}() Date: Mon, 25 May 2020 00:42:29 +0900 Message-Id: <20200524154235.380482-24-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200524154235.380482-1-masahiroy@kernel.org> References: <20200524154235.380482-1-masahiroy@kernel.org> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org check_exports() is never called for vmlinux because mod->skip is set for vmlinux. Hence, check_for_gpl_usage() and check_for_unused() are not called for vmlinux, either. is_vmlinux() is always false here. Remove the is_vmlinux() calls, and hard-code the ".ko" suffix. Signed-off-by: Masahiro Yamada --- Changes in v2: None scripts/mod/modpost.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 94404374262a..c0bc8a2ea026 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2144,20 +2144,18 @@ void buf_write(struct buffer *buf, const char *s, int len) static void check_for_gpl_usage(enum export exp, const char *m, const char *s) { - const char *e = is_vmlinux(m) ?"":".ko"; - switch (exp) { case export_gpl: - fatal("GPL-incompatible module %s%s " - "uses GPL-only symbol '%s'\n", m, e, s); + fatal("GPL-incompatible module %s.ko uses GPL-only symbol '%s'\n", + m, s); break; case export_unused_gpl: - fatal("GPL-incompatible module %s%s " - "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s); + fatal("GPL-incompatible module %s.ko uses GPL-only symbol marked UNUSED '%s'\n", + m, s); break; case export_gpl_future: - warn("GPL-incompatible module %s%s " - "uses future GPL-only symbol '%s'\n", m, e, s); + warn("GPL-incompatible module %s.ko uses future GPL-only symbol '%s'\n", + m, s); break; case export_plain: case export_unused: @@ -2169,13 +2167,11 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s) static void check_for_unused(enum export exp, const char *m, const char *s) { - const char *e = is_vmlinux(m) ?"":".ko"; - switch (exp) { case export_unused: case export_unused_gpl: - warn("module %s%s " - "uses symbol '%s' marked UNUSED\n", m, e, s); + warn("module %s.ko uses symbol '%s' marked UNUSED\n", + m, s); break; default: /* ignore */