public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	andreas.noever@gmail.com, michael.jamet@intel.com,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	YehezkelShB@gmail.com, USB list <linux-usb@vger.kernel.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: make localmodconfig doesn't work for thunderbolt
Date: Sat, 13 May 2023 19:28:21 -0400	[thread overview]
Message-ID: <20230513192821.34ca93fd@rorschach.local.home> (raw)
In-Reply-To: <CAK7LNATQeT8MaQr450x0SpHJV=QU7nrfWfDO1ZRKimppVZG4KA@mail.gmail.com>

On Fri, 12 May 2023 01:15:49 +0900
Masahiro Yamada <masahiroy@kernel.org> wrote:

> +CC Steven Rostedt, author of streamline_config.pl

Thanks!

> 
> 
> 
> On Wed, May 10, 2023 at 8:01 PM Jiri Slaby <jirislaby@kernel.org> wrote:
> >
> > Hi,
> >
> > if I use localmodconfig for example like this:
> > mkdir /tmp/tb/
> > echo thunderbolt >/tmp/tb/lsmod
> > make O=/tmp/tb LSMOD=/tmp/tb/lsmod localmodconfig
> >
> > I get:
> > using config: '.config'
> > thunderbolt config not found!!
> >
> > $ grep 'USB4\>' /tmp/tb/.config
> > # CONFIG_USB4 is not set
> >
> > I believe it's due to:
> >    obj-${CONFIG_USB4} := thunderbolt.o
> > in drivers/thunderbolt/Makefile. I.e. ${} used instead of more common $().
> >
> > But even if I change the parser:
> >
> > --- a/scripts/kconfig/streamline_config.pl
> > +++ b/scripts/kconfig/streamline_config.pl
> > @@ -317,7 +317,7 @@ foreach my $makefile (@makefiles) {
> >          $_ = convert_vars($_, %make_vars);
> >
> >          # collect objects after obj-$(CONFIG_FOO_BAR)
> > -       if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
> > +       if (/obj-\$[({](CONFIG_[^})]*)[)}]\s*[+:]?=\s*(.*)/) {
> >              $var = $1;
> >              $objs = $2;
> >
> >
> > I see:
> > module thunderbolt did not have configs CONFIG_USB4
> >
> > and:
> > $ grep 'USB4\>' /tmp/tb/.config
> > # CONFIG_USB4 is not set
> >
> > So two questions:
> > 1) is ${} supported and should be the above change sent as a patch? Or
> > should be drivers/thunderbolt/Makefile fixed to use $(). (And maybe
> > other Makefiles too.)  
> 
> 
> I believe streamline_config.pl should be fixed.

So do I.

> 
> There is no good reason to support only $(), but not ${}.

Agreed.

> 
> 
> In fact, the comment line around line 395 of this script
> uses the curly brace style.
> 
>   # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
> 
> 
> 
> 
> 
> 
> > 2) how to fix that 'thunderbolt did not have configs'?  
> 
> That warning is CONFIG_USB4 was unset in the resulting .config.
> 
> Was CONFIG_USB4 enabled before running localmodconfig?
> 
> In my understanding, the purpose of localmodconfig
> is to slim down the .config file.

Correct.

> 
> It disables unneeded CONFIG options, but
> it does not enable needed CONFIG options.

Also correct.

> 
> 
> 
> 
> If I start from allnoconfig (i.e. CONFIG_USB4 is unset), I see the warning.
> 
> $ echo thunderbolt >/tmp/tb/lsmod
> $ make -s O=/tmp/tb allnoconfig
> $ make O=/tmp/tb LSMOD=/tmp/tb/lsmod  localmodconfig
>   GEN     Makefile
> using config: '.config'
> module thunderbolt did not have configs CONFIG_USB4
> 
> 
> 
> If I start from allmodconfig (i.e. CONFIG_USB4 is m), I do not see the warning.
> 
> $ echo thunderbolt >/tmp/tb/lsmod
> $ make -s O=/tmp/tb allmodconfig
> $ make O=/tmp/tb LSMOD=/tmp/tb/lsmod  localmodconfig
>   GEN     Makefile
> using config: '.config'
> 

I hate the inconsistency in the Makefile, but localmodconfig should be
able to adapt to it.

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Thanks Jiri and Masamhiro!

-- Steve

  reply	other threads:[~2023-05-13 23:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 11:00 make localmodconfig doesn't work for thunderbolt Jiri Slaby
2023-05-11  8:51 ` Mika Westerberg
2023-05-11 16:15 ` Masahiro Yamada
2023-05-13 23:28   ` Steven Rostedt [this message]
2023-05-13 23:30     ` Steven Rostedt
2023-06-06  4:16 ` Masahiro Yamada
2023-06-06  6:52   ` Jiri Slaby

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=20230513192821.34ca93fd@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox