All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: NeilBrown <neilb@suse.com>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a
Date: Wed, 4 Jul 2018 21:08:43 +0900	[thread overview]
Message-ID: <CAK7LNAS22VUQytcX=BQt48qeAn9Rq00Sb555Gu98J+=8R_3OVA@mail.gmail.com> (raw)
In-Reply-To: <87efgk0xx7.fsf@notabene.neil.brown.name>

2018-07-04 7:14 GMT+09:00 NeilBrown <neilb@suse.com>:
> On Wed, Jun 27 2018, Masahiro Yamada wrote:
>
>> 2018-06-18 13:55 GMT+09:00 NeilBrown <neilb@suse.com>:
>>> 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


I prefer flat directory structure for modules.
Most of modules fit in a single directory.


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2018-07-04 12:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18  4:55 [RFC PATCH 0/5] kbuild: build modules from code in multiple directories NeilBrown
2018-06-18  4:55 ` [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a NeilBrown
2018-06-27  5:52   ` Masahiro Yamada
2018-07-03 22:14     ` NeilBrown
2018-07-04 12:08       ` Masahiro Yamada [this message]
2018-07-04 21:54         ` NeilBrown
2018-07-05  9:06           ` Masahiro Yamada
2018-07-05 23:03             ` NeilBrown
2018-06-18  4:55 ` [PATCH 3/5] kbuild: support building of per-directory mod.a NeilBrown
2018-06-19  3:57   ` [PATCH 3/5 - v2] " NeilBrown
2018-06-18  4:55 ` [PATCH 1/5] kbuild: detect directories in components of a module NeilBrown
2018-06-18  4:55 ` [PATCH 2/5] kbuild: treat a directory listed in a composite object as foo/mod.a NeilBrown
2018-06-18  9:14   ` kbuild test robot
2018-06-18 22:30     ` NeilBrown
2018-06-18 22:30       ` NeilBrown
2018-06-18  4:55 ` [PATCH 5/5] kbuild: Add documentation for modobj-m NeilBrown
2018-06-18  8:20 ` [RFC PATCH 0/5] kbuild: build modules from code in multiple directories Christoph Hellwig
2018-06-19  4:05   ` NeilBrown
2018-06-19  4:47     ` Christoph Hellwig
2018-06-19  5:03       ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNAS22VUQytcX=BQt48qeAn9Rq00Sb555Gu98J+=8R_3OVA@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.