linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kconfig: change .config format to use =n instead of "is not set"
Date: Sat, 5 Mar 2022 08:18:47 +0100	[thread overview]
Message-ID: <CA+icZUWBO3S4DVqDR=fQ8O07JM+w-3ThgnaBqMPo9YhivtoULA@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUXkd=dtbBX3UKLRzGiVSKC=TeW7ATiRKD9dnYtmm6RZqg@mail.gmail.com>

On Sun, Feb 27, 2022 at 8:54 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Sun, Feb 27, 2022 at 5:24 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > On Sun, Feb 27, 2022 at 6:38 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> > >
> > > On Sat, Feb 26, 2022 at 2:34 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > >
> > > > The .config file uses "# CONFIG_FOO is not set" form to represent
> > > > disabled options. In the old days, it was useful because the .config
> > > > was directly included from Makefiles. For example, you can use
> > > > "ifdef CONFIG_FOO" in Makefiles to check if the option is enabled.
> > > >
> > > > Commit c955ccafc38e ("kconfig: fix .config dependencies") introduced
> > > > include/config/auto.conf, which mirrors the .config, but trims down
> > > > all disabled options.
> > > >
> > > > Since then, include/config/auto.conf defines CONFIG options during the
> > > > build. The .config is used just for storing the user's configuration.
> > > > I do not see a strong reason to use a particular pattern of comment
> > > > for disabled options.
> > > >
> > > > With this commit, Kconfig will output disable options in a more natural
> > > > form, "CONFIG_FOO=n".
> > > >
> > > > Kconfig accepts both "# CONFIG_FOO is not set" and "CONFIG_FOO=n" as a
> > > > valid input. You do not need to update arch/*/configs/*_defconfig files
> > > > for now. "git bisect" should be able to cross the commit in both ways
> > > > without any issue.
> > > >
> > >
> > > Good.
> > >
> > > Lot of people use/used the notation CONFIG_FOO=n, so did I.
> > >
> > > Thanks for keeping the "compatibility" with old usage "# CONFIG_FOO is not set".
> > >
> > > Normally, I use git diff (or scripts/diffconfig in Git tree) to
> > > compare two kernel-configs, so seeing
> > >
> > > -CONFIG_FOO=y
> > > +CONFIG_FOO=n
> > >
> > > ...might be at first view unfamiliar/unusual.
> > > With the old notation it was easier to see that Kconfig is unset.
> >
> > I agree on this point.
> >
> > "is not set" stands out much better than "=n",
> > and our eyes are accustomed to this notation for 20 years.
> >
> > However, real comments do not stand out since
> > we already (ab)use comments for disabled options.
> >
> > This is related thread
> > https://patchwork.kernel.org/project/linux-kbuild/patch/20211213100043.45645-3-arielmarcovitch@gmail.com/
> >
>
> Thanks for the link.
>
> > >
> > > Is this patch on top of kbuild-next Git?
> > >
> >
> > Yes.
>
> Let me see if I will try kbuild-next with this patch on top of
> upcoming Linux v5.17-rc6.
>

I was not able to apply your patch on top of latest kbuild-next.git:

$ git log --oneline v5.17-rc6..
3a8276b1ae7e (HEAD -> for-5.17/kbuild-next-2022022) Merge branch
'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
into for-5.17/kbuild-next-2022022
d4c858643263 kallsyms: ignore all local labels prefixed by '.L'
a7d4f58e99dd kconfig: fix missing '# end of' for empty menu
868653f421cd kconfig: add fflush() before ferror() check
5c8166419acf kbuild: replace $(if A,A,B) with $(or A,B)
f67695c9962e kbuild: Add environment variables for userprogs flags
a5575df58004 kbuild: unify cmd_copy and cmd_shipped

$ LC_ALL=C git apply --check --verbose
../20220226_masahiroy_kconfig_change_config_format_to_use_n_instead_of_is_not_set.mbx
Checking patch scripts/kconfig/confdata.c...
error: while searching for:
       return out;
}

enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE };

static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n,
                          bool escape_string)
{
       const char *val;

error: patch failed: scripts/kconfig/confdata.c:658
error: scripts/kconfig/confdata.c: patch does not apply
Checking patch scripts/kconfig/merge_config.sh...
Checking patch scripts/kconfig/streamline_config.pl...
Checking patch scripts/kconfig/tests/choice/alldef_expected_config...
Checking patch scripts/kconfig/tests/choice/allmod_expected_config...
Checking patch scripts/kconfig/tests/choice/allno_expected_config...
Checking patch scripts/kconfig/tests/choice/allyes_expected_config...
Checking patch scripts/kconfig/tests/choice/oldask1_config...
Checking patch scripts/kconfig/tests/inter_choice/expected_config...
Checking patch scripts/kconfig/tests/new_choice_with_dep/config...
Checking patch scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py...
Checking patch scripts/kconfig/tests/no_write_if_dep_unmet/expected_config...

$ git log --oneline v5.17-rc6.. scripts/kconfig/confdata.c
a7d4f58e99dd kconfig: fix missing '# end of' for empty menu
868653f421cd kconfig: add fflush() before ferror() check

- Sedat -

  reply	other threads:[~2022-03-05  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 12:37 [PATCH] kconfig: change .config format to use =n instead of "is not set" Masahiro Yamada
2022-02-26 21:37 ` Sedat Dilek
2022-02-27  4:23   ` Masahiro Yamada
2022-02-27  7:54     ` Sedat Dilek
2022-03-05  7:18       ` Sedat Dilek [this message]
2022-03-02 13:16 ` Boris Kolpackov
2022-03-03  0:01   ` Masahiro Yamada

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='CA+icZUWBO3S4DVqDR=fQ8O07JM+w-3ThgnaBqMPo9YhivtoULA@mail.gmail.com' \
    --to=sedat.dilek@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).