From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:43168 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753183AbeGCWOg (ORCPT ); Tue, 3 Jul 2018 18:14:36 -0400 From: NeilBrown Date: Wed, 04 Jul 2018 08:14:28 +1000 Subject: Re: [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a In-Reply-To: References: <152929708853.17463.17302660556961083137.stgit@noble> <152929772052.17463.10728056000221362647.stgit@noble> Message-ID: <87efgk0xx7.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Masahiro Yamada Cc: Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list --=-=-= Content-Type: text/plain On Wed, Jun 27 2018, Masahiro Yamada wrote: > 2018-06-18 13:55 GMT+09:00 NeilBrown : >> When building an object to be included in mod.a we >> cannot know the name of the module. So don't define >> KBUILD_MODNAME. This will ensure attempt to use >> that macro when the module name isn't know will >> trigger an error. > > Honestly, I hate KBUILD_MODNAME. > > If KBUILD_MODNAME is undefined, > you cannot call pr_debug() in the sub-directory for example. I think this is only true if you have something like #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt in your .c files. Developers who use modobj-m could be advised not to do this. > > CONFIG_DYNAMIC_DEBUG requires KBUILD_MODNAME, > but people often miss to notice that, then cause build errors. Yes, I can see that. We could change it to use a default ("no-name") if KBUILD_MODNAME isn't defined. Or we could require that KBUILD_MODNAME always be defined. Where I've been using these patches I've sometimes been adding ccflags-y += -DKBUILD_MODNAME='"FOO"' to Makefiles so that modules_params get handled correctly on non-module builds. I've thought about instead allowing "modobj-name" to be defined and requiring that it be set if either modobj-[yn] is set. Then it gets used for the KBUILD_MODNAME when building modobj modules. Would you prefer to always require KBUILD_MODNAME, or to use a default name for dynamic-debug? Thanks, NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAls79UQACgkQOeye3VZi gbkeuw//Qmp9HcEtcoeR8iagsbCxtosyNdqv4zrcLVMtTIOc3ECO8dFFPtKvVyUB uu3/HnDYNwx2En59vilrk1pdfpKe97ivK4MBzQ/ztMspploxGuVqL0qrExjxKYXB shkzEhxu8bjSRiZ7DpOBMN2ngUDN+oIbcmRST3UuYlJz4yUleqoI3wpWpcO6faQ6 wFNRbV7SUT5LRaunEeIyWIzgvOqIU+97iv2AeCyZjfOL5del/v/IKdeMj9JVFJQK 8UUmF8oktj8Rys+5eJ0jjxqhsOatUiwnsF4ThrC3eR3gro62RFkgfTMb4tzZ/jAU s5G8diFhqzwg+KXCD2WdnmejWqjuHWCZvAvJzZ8KfomcfP7kjE8kMjJSZun4xh1j Th29yWuH2jYm5/Ltw9YftqXjogrxdMmscl3Xotdz9m1NUQVar2Y27BZm3v2E5Mw7 FsMmgml1rCDh6OuVxY8j2hoB+1TbBx4Yo7uwp/DL/8WUKKb6rTVxdZ8oiot6YqH1 RskoE1jXW7xf4ZOtFGZ4+u4qORqd+x8hMyEFY/tx2vA5ULC539QxoFtL1saIuU9M LET3AgxhGO70C1cGJtzgPLyzNkCVARcSaFINB52qpRtKcBYiwJGagJS5t9ZF92+U Y/xa0Q05t5wCpeuxKtfNbr2whMSLnSA9GS5gTpRqazF4tQEWcuA= =G3LZ -----END PGP SIGNATURE----- --=-=-=--