From nobody Wed Sep 30 13:30:08 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71F754746A3; Fri, 7 Aug 2026 16:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786120197; cv=none; b=rnkMEx9ZuSwVmWtphH5ypxn+YEwzXPDU+9ExzqzYbeGiXFN+oc3n1hvlMhVULxTXsty2lLd9JtS+WshTgBdpHOL1nmwAA63Aslc0ov+3O4neniTebChRaFVO0atb5PA8tRbTBmD4+KcS7HE9pc5+FCnis3bNPkv2tZpHCXYdv7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786120197; c=relaxed/simple; bh=PUA+vCvTfmfOFW1/uln3K2ruNfo/Xm5M7RrcGpZTVYc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WaeOkrOEccYaycAkXAKVDj4l4K3+v+kuycY8kbSzfDK5HlXMlNAumPBlSyPzV0Nw7T74jD79VUUboRQCKdi8c5FyYjsmxvqJahqnEtvM1RpC6ODRraaBT8jSjPAeC/tUmJfsYbjMo7WS2sI54Df6C9JMDv0k283nlnaRRzS/jps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Xztkuktq; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xztkuktq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786120196; x=1817656196; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PUA+vCvTfmfOFW1/uln3K2ruNfo/Xm5M7RrcGpZTVYc=; b=XztkuktqQLftT7nk0zZKg6ZvSmi6S4s51aN142QHEAxFEz6koc5qyzKy TRVaWd19tHucFS3kNU+Q/RJWTf+IJz7YFZgxR/u4htzrixdKAAihz566+ GJYSSjfTNYkipJP8Z9dHMBUYktwAFWGqoUnUxNjJ+nYSeKPlDq2dlsSNn BakmcH3jM4mofGZ59wXwHGVzc9DEcQYbKdOEmUWScfIJwpFhF4yWgDrvU rta/ivIee2wnFlds+/BvrmBEpX51E1m7mXMb9ndqmjhKkpoVTmFWSUXaI NHToMPApVQ4VufX9wopMid8+GgqIYpRfMOOxSzRDeRpRI7F104VqhcFkf Q==; X-CSE-ConnectionGUID: KJsqz/+FQnCgTUSqTOOTxQ== X-CSE-MsgGUID: WtO8N4PRSDOCqFCLh+RinA== X-IronPort-AV: E=McAfee;i="6800,10657,11868"; a="86493101" X-IronPort-AV: E=Sophos;i="6.25,210,1779174000"; d="scan'208";a="86493101" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2026 09:29:56 -0700 X-CSE-ConnectionGUID: tjxhk8+wQOuVFdtBTJYu3w== X-CSE-MsgGUID: sOtpln6ORk6ecojs5/4CJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,210,1779174000"; d="scan'208";a="258585317" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.152]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2026 09:29:53 -0700 From: Jani Nikula To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nathan Chancellor , Nicolas Schier , jani.nikula@intel.com Subject: [PATCH 1/2] modpost: add module as parameter to modpost_log() Date: Fri, 7 Aug 2026 19:29:40 +0300 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" modpost has a lot of error logging with module name, but the module name is logged in a plethora of ways. Add struct module * parameter to modpost_log(), and wrappers mod_warn() and mod_error(), to allow logging with a unified module name, if provided. If the module is provided, the messages will be of the format: (ERROR|WARNING): modpost: (modname.ko|vmlinux): message Actual conversion is done separately. Cc: Nathan Chancellor Cc: Nicolas Schier Signed-off-by: Jani Nikula Reviewed-by: Nathan Chancellor Reviewed-by: Nicolas Schier --- scripts/mod/modpost.c | 12 +++++++++--- scripts/mod/modpost.h | 8 ++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index a7b72a81d248..240b45ff92f8 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -74,7 +74,7 @@ static unsigned int nr_unresolved; =20 #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) =20 -void modpost_log(bool is_error, const char *fmt, ...) +void modpost_log(bool is_error, struct module *mod, const char *fmt, ...) { va_list arglist; =20 @@ -87,11 +87,17 @@ void modpost_log(bool is_error, const char *fmt, ...) =20 fprintf(stderr, "modpost: "); =20 + if (mod) + fprintf(stderr, "%s%s: ", mod->name, mod->is_vmlinux ? "" : ".ko"); + va_start(arglist, fmt); vfprintf(stderr, fmt, arglist); va_end(arglist); } =20 +#define mod_warn(mod, fmt, args...) modpost_log(false, mod, fmt, ##args) +#define mod_error(mod, fmt, args...) modpost_log(true, mod, fmt, ##args) + static inline bool strends(const char *str, const char *postfix) { if (strlen(str) < strlen(postfix)) @@ -1772,7 +1778,7 @@ static void check_exports(struct module *mod) exp =3D find_symbol(s->name); if (!exp) { if (!s->weak && nr_unresolved++ < MAX_UNRESOLVED_REPORTS) - modpost_log(!warn_unresolved, + modpost_log(!warn_unresolved, NULL, "\"%s\" [%s.ko] undefined!\n", s->name, mod->name); continue; @@ -1792,7 +1798,7 @@ static void check_exports(struct module *mod) =20 if (!verify_module_namespace(exp->namespace, basename) && !contains_namespace(&mod->imported_namespaces, exp->namespace)) { - modpost_log(!allow_missing_ns_imports, + modpost_log(!allow_missing_ns_imports, NULL, "module %s uses symbol %s from namespace %s, but does not import i= t.\n", basename, exp->name, exp->namespace); add_namespace(&mod->missing_namespaces, exp->namespace); diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 2aecb8f25c87..d5f6d82837d5 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -223,8 +223,8 @@ char *read_text_file(const char *filename); char *get_line(char **stringp); void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym); =20 -void __attribute__((format(printf, 2, 3))) -modpost_log(bool is_error, const char *fmt, ...); +void __attribute__((format(printf, 3, 4))) +modpost_log(bool is_error, struct module *mod, const char *fmt, ...); =20 /* * warn - show the given message, then let modpost continue running, still @@ -239,6 +239,6 @@ modpost_log(bool is_error, const char *fmt, ...); * fatal - show the given message, and bail out immediately. This should be * used when there is no point to continue running modpost. */ -#define warn(fmt, args...) modpost_log(false, fmt, ##args) -#define error(fmt, args...) modpost_log(true, fmt, ##args) +#define warn(fmt, args...) modpost_log(false, NULL, fmt, ##args) +#define error(fmt, args...) modpost_log(true, NULL, fmt, ##args) #define fatal(fmt, args...) do { error(fmt, ##args); exit(1); } while (1) --=20 2.47.3 From nobody Wed Sep 30 13:30:08 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47710473C7D; Fri, 7 Aug 2026 16:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786120203; cv=none; b=NJ229mNf0kRnlrMCZKdy97NhJ47v1nf4VffC3YLU0kwEg/omCoQnXL4b1+rxaAeaCzBPqbNNLW0YaxxWTSjtnpcv9CZzxXSIXlDHepSnnJliBiZtcd9jjtfOfmweskToHPrBssNiaowYeDaF8yRDxzMJK3AO6KHxSdWgWAe+wyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786120203; c=relaxed/simple; bh=U6uJBP2yW4sZjp3hsch5acHvSaqHDDZqD7L9TpUr93c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P91J72bcMkgIsyeLVCfACgEiCAQdes50s5RyGKwHQhvKpdy+myWrW8F/VU5X9f3kJtTeKJybv03Hc4730z/4MPldvKnTfkN/7ldqRX/xbdkPo+do2i3AXYIi/KxgzdvoirNQ8P81rtYXdb+GBjGxt+TR00j0UhUfvZr9a+bXkdw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=InqB5j6n; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="InqB5j6n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786120201; x=1817656201; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U6uJBP2yW4sZjp3hsch5acHvSaqHDDZqD7L9TpUr93c=; b=InqB5j6n0vRkBZd4yufFgF5h9GasEgEb9797ngtImlovqTIALzQl+5ue AQ6urt+MilKTSR81mKbvuyjH93vtmnTItF7VFB2qtm97shJwlJg4FSIUM HAO8pJ1TeduQ8gN2S8PifssEyFZmjB1C4hNYLCt6JBghPEqf32eKXjmMZ SoS1eagbstoCfjXfKGhgl/wU6/9OccesnAqpMgzswN0EkAuvuPm51zIr0 EvxUH49vtapp9diQsDPxSKw077wTnAXtmCT8rcm8CUDh4Rhc4Ovy/6tFf drko4JiBYPxJ0H5+KbWCpk9Ub/5Lxg8lIL4cONfPdJssRUaTVYXs1I0Fi g==; X-CSE-ConnectionGUID: TMnzhuXVSj69JR4HBPEmKA== X-CSE-MsgGUID: 7jcF//z9Q5K6CYDItZenzQ== X-IronPort-AV: E=McAfee;i="6800,10657,11868"; a="90613386" X-IronPort-AV: E=Sophos;i="6.25,210,1779174000"; d="scan'208";a="90613386" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2026 09:30:01 -0700 X-CSE-ConnectionGUID: M4tYinuxTIm9dU393Bq+sQ== X-CSE-MsgGUID: h4ZWm3ciRwGsoXHXO6X0bQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,210,1779174000"; d="scan'208";a="300639587" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.152]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2026 09:29:58 -0700 From: Jani Nikula To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nathan Chancellor , Nicolas Schier , jani.nikula@intel.com Subject: [PATCH 2/2] modpost: use mod_warn() and mod_error(), clean up logging Date: Fri, 7 Aug 2026 19:29:41 +0300 Message-ID: <17ed1bce5d54fb32533ba83bc83c429cb71adcb0.1786120005.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Convert all module name logging to use the mod_warn() and mod_error() helpers, and pass the module to modpost_log() where used directly, to always have the module name prefixed in the log message, with .ko suffix for modules. Pass struct module *mod around in a few places instead of just mod->name. Further unify the logging while at it. Use single quotes instead of double quotes for symbols, sections, and namespaces. Explicitly state it's a "symbol" when referencing symbols. Cc: Nathan Chancellor Cc: Nicolas Schier Signed-off-by: Jani Nikula Reviewed-by: Nathan Chancellor Reviewed-by: Nicolas Schier --- Tip: easiest to review by applying and using 'git show --color-words' --- scripts/mod/modpost.c | 104 ++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 55 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 240b45ff92f8..c2202cb2c434 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -365,9 +365,8 @@ static struct symbol *sym_add_exported(const char *name= , struct module *mod, struct symbol *s =3D find_symbol(name); =20 if (s && (!external_module || s->module->is_vmlinux || s->module =3D=3D m= od)) { - error("%s: '%s' exported twice. Previous export was in %s%s\n", - mod->name, name, s->module->name, - s->module->is_vmlinux ? "" : ".ko"); + mod_error(mod, "symbol '%s' exported twice. Previous export was in %s%s\= n", + name, s->module->name, s->module->is_vmlinux ? "" : ".ko"); } =20 s =3D alloc_symbol(name); @@ -638,7 +637,7 @@ static void handle_symbol(struct module *mod, struct el= f_info *info, if (strstarts(symname, "__gnu_lto_")) { /* Should warn here, but modpost runs before the linker */ } else - warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); + mod_warn(mod, "'%s' is COMMON symbol\n", symname); break; case SHN_UNDEF: /* undefined symbol */ @@ -781,7 +780,7 @@ static const char *const section_white_list[] =3D * The cause of this is often a section specified in assembler * without "ax" / "aw". */ -static void check_section(const char *modname, struct elf_info *elf, +static void check_section(struct module *mod, struct elf_info *elf, Elf_Shdr *sechdr) { const char *sec =3D sech_name(elf, sechdr); @@ -789,11 +788,11 @@ static void check_section(const char *modname, struct= elf_info *elf, if (sechdr->sh_type =3D=3D SHT_PROGBITS && !(sechdr->sh_flags & SHF_ALLOC) && !match(sec, section_white_list)) { - warn("%s (%s): unexpected non-allocatable section.\n" - "Did you forget to use \"ax\"/\"aw\" in a .S file?\n" - "Note that for example contains\n" - "section definitions for use in .S files.\n\n", - modname, sec); + mod_warn(mod, "unexpected non-allocatable section '%s'.\n" + "Did you forget to use \"ax\"/\"aw\" in a .S file?\n" + "Note that for example contains\n" + "section definitions for use in .S files.\n\n", + sec); } } =20 @@ -1027,7 +1026,7 @@ static bool is_executable_section(struct elf_info *el= f, unsigned int secndx) return (elf->sechdrs[secndx].sh_flags & SHF_EXECINSTR) !=3D 0; } =20 -static void default_mismatch_handler(const char *modname, struct elf_info = *elf, +static void default_mismatch_handler(struct module *mod, struct elf_info *= elf, const struct sectioncheck* const mismatch, Elf_Sym *tsym, unsigned int fsecndx, const char *fromsec, Elf_Addr faddr, @@ -1057,10 +1056,10 @@ static void default_mismatch_handler(const char *mo= dname, struct elf_info *elf, * The format for the reference source: + or * The format for the reference destination: or */ - warn("%s: section mismatch in reference: %s%s0x%x (section: %s) -> %s (se= ction: %s)\n", - modname, fromsym, fromsym[0] ? "+" : "", - (unsigned int)(faddr - (fromsym[0] ? from->st_value : 0)), - fromsec, tosym[0] ? tosym : taddr_str, tosec); + mod_warn(mod, "section mismatch in reference: %s%s0x%x (section: %s) -> %= s (section: %s)\n", + fromsym, fromsym[0] ? "+" : "", + (unsigned int)(faddr - (fromsym[0] ? from->st_value : 0)), + fromsec, tosym[0] ? tosym : taddr_str, tosec); =20 if (mismatch->mismatch =3D=3D EXTABLE_TO_NON_TEXT) { if (match(tosec, mismatch->bad_tosec)) @@ -1069,7 +1068,7 @@ static void default_mismatch_handler(const char *modn= ame, struct elf_info *elf, "Something is seriously wrong and should be fixed.\n" "You might get more information about where this is\n" "coming from by using scripts/check_extable.sh %s\n", - fromsec, (long)faddr, tosec, modname); + fromsec, (long)faddr, tosec, mod->name); else if (is_executable_section(elf, get_secindex(elf, tsym))) warn("The relocation at %s+0x%lx references\n" "section \"%s\" which is not in the list of\n" @@ -1099,22 +1098,22 @@ static void check_export_symbol(struct module *mod,= struct elf_info *elf, label_name =3D sym_name(elf, label); =20 if (!strstarts(label_name, prefix)) { - error("%s: .export_symbol section contains strange symbol '%s'\n", - mod->name, label_name); + mod_error(mod, ".export_symbol section contains strange symbol '%s'\n", + label_name); return; } =20 if (ELF_ST_BIND(sym->st_info) !=3D STB_GLOBAL && ELF_ST_BIND(sym->st_info) !=3D STB_WEAK) { - error("%s: local symbol '%s' was exported\n", mod->name, - label_name + strlen(prefix)); + mod_error(mod, "local symbol '%s' was exported\n", + label_name + strlen(prefix)); return; } =20 name =3D sym_name(elf, sym); if (strcmp(label_name + strlen(prefix), name)) { - error("%s: .export_symbol section references '%s', but it does not seem = to be an export symbol\n", - mod->name, name); + mod_error(mod, ".export_symbol section references '%s', but it does not = seem to be an export symbol\n", + name); return; } =20 @@ -1124,8 +1123,8 @@ static void check_export_symbol(struct module *mod, s= truct elf_info *elf, } else if (!strcmp(data, "")) { is_gpl =3D false; } else { - error("%s: unknown license '%s' was specified for '%s'\n", - mod->name, data, name); + mod_error(mod, "unknown license '%s' was specified for '%s'\n", + data, name); return; } =20 @@ -1148,11 +1147,11 @@ static void check_export_symbol(struct module *mod,= struct elf_info *elf, s->is_func =3D true; =20 if (match(secname, PATTERNS(ALL_INIT_SECTIONS))) - warn("%s: %s: EXPORT_SYMBOL used for init symbol. Remove __init or EXPOR= T_SYMBOL.\n", - mod->name, name); + mod_warn(mod, "EXPORT_SYMBOL used for init symbol '%s'. Remove __init or= EXPORT_SYMBOL.\n", + name); else if (match(secname, PATTERNS(ALL_EXIT_SECTIONS))) - warn("%s: %s: EXPORT_SYMBOL used for exit symbol. Remove __exit or EXPOR= T_SYMBOL.\n", - mod->name, name); + mod_warn(mod, "EXPORT_SYMBOL used for exit symbol '%s'. Remove __exit or= EXPORT_SYMBOL.\n", + name); } =20 static void check_section_mismatch(struct module *mod, struct elf_info *el= f, @@ -1172,7 +1171,7 @@ static void check_section_mismatch(struct module *mod= , struct elf_info *elf, if (!mismatch) return; =20 - default_mismatch_handler(mod->name, elf, mismatch, sym, + default_mismatch_handler(mod, elf, mismatch, sym, fsecndx, fromsec, faddr, tosec, taddr); } @@ -1449,7 +1448,7 @@ static void check_sec_ref(struct module *mod, struct = elf_info *elf) for (i =3D 0; i < elf->num_sections; i++) { Elf_Shdr *sechdr =3D &elf->sechdrs[i]; =20 - check_section(mod->name, elf, sechdr); + check_section(mod, elf, sechdr); /* We want to process only relocation sections and not .init */ if (sechdr->sh_type =3D=3D SHT_REL || sechdr->sh_type =3D=3D SHT_RELA) { /* section to which the relocation applies */ @@ -1619,7 +1618,7 @@ static void read_symbols(const char *modname) if (!mod->is_vmlinux) { license =3D get_modinfo(&info, "license"); if (!license) - error("missing MODULE_LICENSE() in %s\n", modname); + mod_error(mod, "missing MODULE_LICENSE()\n"); while (license) { if (!license_is_gpl_compatible(license)) { mod->is_gpl_compatible =3D false; @@ -1632,14 +1631,14 @@ static void read_symbols(const char *modname) namespace; namespace =3D get_next_modinfo(&info, "import_ns", namespace)) { if (strstarts(namespace, MODULE_NS_PREFIX)) - error("%s: explicitly importing namespace \"%s\" is not allowed.\n", - mod->name, namespace); + mod_error(mod, "explicitly importing namespace '%s' is not allowed.\n", + namespace); =20 add_namespace(&mod->imported_namespaces, namespace); } =20 if (!get_modinfo(&info, "description")) - warn("missing MODULE_DESCRIPTION() in %s\n", modname); + mod_warn(mod, "missing MODULE_DESCRIPTION()\n"); } =20 for (sym =3D info.symtab_start; sym < info.symtab_stop; sym++) { @@ -1778,14 +1777,13 @@ static void check_exports(struct module *mod) exp =3D find_symbol(s->name); if (!exp) { if (!s->weak && nr_unresolved++ < MAX_UNRESOLVED_REPORTS) - modpost_log(!warn_unresolved, NULL, - "\"%s\" [%s.ko] undefined!\n", - s->name, mod->name); + modpost_log(!warn_unresolved, mod, + "symbol '%s' undefined!\n", + s->name); continue; } if (exp->module =3D=3D mod) { - error("\"%s\" [%s.ko] was exported without definition\n", - s->name, mod->name); + mod_error(mod, "symbol '%s' was exported without definition\n", s->name= ); continue; } =20 @@ -1798,15 +1796,15 @@ static void check_exports(struct module *mod) =20 if (!verify_module_namespace(exp->namespace, basename) && !contains_namespace(&mod->imported_namespaces, exp->namespace)) { - modpost_log(!allow_missing_ns_imports, NULL, - "module %s uses symbol %s from namespace %s, but does not import i= t.\n", - basename, exp->name, exp->namespace); + modpost_log(!allow_missing_ns_imports, mod, + "module uses symbol '%s' from namespace '%s', but does not import = it.\n", + exp->name, exp->namespace); add_namespace(&mod->missing_namespaces, exp->namespace); } =20 if (!mod->is_gpl_compatible && exp->is_gpl_only) - error("GPL-incompatible module %s.ko uses GPL-only symbol '%s'\n", - basename, exp->name); + mod_error(mod, "GPL-incompatible module uses GPL-only symbol '%s'\n", + exp->name); } } =20 @@ -1856,7 +1854,7 @@ static void check_modname_len(struct module *mod) mod_name =3D get_basename(mod->name); =20 if (strlen(mod_name) >=3D MODULE_NAME_LEN) - error("module name is too long [%s.ko]\n", mod->name); + mod_error(mod, "module name is too long\n"); } =20 /** @@ -1920,10 +1918,9 @@ static void add_exported_symbols(struct buffer *buf,= struct module *mod) continue; =20 if (!sym->crc_valid) - warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol wil= l not be versioned.\n" - "Is \"%s\" prototyped in ?\n", - sym->name, mod->name, mod->is_vmlinux ? "" : ".ko", - sym->name); + mod_warn(mod, "EXPORT symbol '%s' version generation failed, symbol wil= l not be versioned.\n" + "Is '%s' prototyped in ?\n", + sym->name, sym->name); =20 buf_printf(buf, "SYMBOL_CRC(%s, 0x%08x);\n", sym->name, sym->crc); @@ -1947,8 +1944,7 @@ static void add_extended_versions(struct buffer *b, s= truct module *mod) if (!s->module) continue; if (!s->crc_valid) { - warn("\"%s\" [%s.ko] has no CRC!\n", - s->name, mod->name); + mod_warn(mod, "symbol '%s' has no CRC!\n", s->name); continue; } buf_printf(b, "\t0x%08x,\n", s->crc); @@ -1991,8 +1987,7 @@ static void add_versions(struct buffer *b, struct mod= ule *mod) if (!s->module) continue; if (!s->crc_valid) { - warn("\"%s\" [%s.ko] has no CRC!\n", - s->name, mod->name); + mod_warn(mod, "symbol '%s' has no CRC!\n", s->name); continue; } if (strlen(s->name) >=3D MODULE_NAME_LEN) { @@ -2000,8 +1995,7 @@ static void add_versions(struct buffer *b, struct mod= ule *mod) /* this symbol will only be in the extended info */ continue; } else { - error("too long symbol \"%s\" [%s.ko]\n", - s->name, mod->name); + mod_error(mod, "too long symbol '%s'\n", s->name); break; } } --=20 2.47.3