Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1176466

Re: Kconfig: '+config' valid syntax?

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Ulf Magnusson <ulfalizer.lkml@gmail.com>
Newsgroups linux.kernel
Subject Re: Kconfig: '+config' valid syntax?
Date Fri, 03 Jul 2015 12:20:01 +0200
Message-ID <pI6eB-7fP-3@gated-at.bofh.it> (permalink)
References <pHHJg-9G-13@gated-at.bofh.it>
X-Original-To Valentin Rothberg <valentinrothberg@gmail.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fnkhQuQfgKEe1Uo75toRK6hMj1RxEY0aqTHi75CtHQI=; b=McwNaK9QRwB7ECQarWYUldugoxWqi/JAVqhfiIpDxoPWukY+ukulUo6ZpNc2P4JM+m hU+2TLny2FJiJHTNElzLDC6ZJw4ye6kPTC89Ilss918lJfp4ywJospYeTp6BSmvsyVEW 4CwJDcDe96B6VVf8cD1sRsRSiWWq1GF28tFfYObghQh3EolIadFeOucLqFxDkI/gHqiT iErfiMXtrdrNfNy/DHkeIfOzt0wPRvil35M0ai8U4isS8WOQ9JkkqjBJqY8eLKzfDmTs g8Nyit5R/Qedzz7Rg4PICKNqGby0yFchQB7tfq6YKbUcQmMKREZMB5ZuTS71rXPzX6mr TdjA==
MIME-Version 1.0
X-Received by 10.60.34.164 with SMTP id a4mr2276278oej.56.1435918583597; Fri, 03 Jul 2015 03:16:23 -0700 (PDT)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc rafael.j.wysocki@intel.com, Paul Bolle <pebolle@tiscali.nl>, yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org, Kernel Mailing List <linux-kernel@vger.kernel.org>, Andreas Ruprecht <andreas.ruprecht@fau.de>, hengelein Stefan <stefan.hengelein@fau.de>, linux@dominikbrodowski.net
X-Original-Date Fri, 3 Jul 2015 12:16:23 +0200
X-Original-Message-ID <CAEMqcmqzkybD1yYhZWYY=hSDePXbhgV0_w_MMtmUBmD+2EDvwg@mail.gmail.com>
X-Original-References <CAD3Xx4Kh9ASyVYo7ZyRyr2maJbXwbqauQ7tUsLBUHof_hsaP2w@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1176466

Show key headers only | View raw


On Thu, Jul 2, 2015 at 10:08 AM, Valentin Rothberg
<valentinrothberg@gmail.com> wrote:
> Hi,
>
> commit ed013214afa7 ("ACPI / init: Make it possible to override _REV")
> is in today's linux-next tree (i.e., next-20150702) adding the
> following hunk to drivers/acpi/Kconfig:
>
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -428,6 +428,26 @@ config XPOWER_PMIC_OPREGION
>         help
>           This config adds ACPI operation region support for XPower AXP288 PMIC.
>
> ++config ACPI_REV_OVERRIDE_POSSIBLE
> +       bool "Allow supported ACPI revision to be overriden"
> +       depends on X86
> +       default y
> [...]
>
> By having a close look at the first added line, we can see that
> '+config ACPI_...' is added.  To my great surprise, it's valid Kconfig
> syntax.  How is that possible?  IMHO it's an invalid token, such that
> Kconfig should complain about it.  Or do I miss something?
>
> Kind regards,
>  Valentin

For another take on this, you could look at the Config._tokenize() function
in Kconfiglib (https://github.com/ulfalizer/Kconfiglib/blob/master/kconfiglib.py).
Here's a relevant comment from that function:

# The initial word on a line is parsed specially. Let
# command_chars = [A-Za-z0-9_]. Then
#  - leading non-command_chars characters are ignored, and
#  - the first token consists the following one or more
#    command_chars characters.
# This is why things like "----help--" are accepted.

The root cause is sloppy lexing in zconf.l, IIRC. I didn't check
whether it's been
improved, but Kconfiglib needs to be backwards compatible either way.

/Ulf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: Kconfig: '+config' valid syntax? Ulf Magnusson <ulfalizer.lkml@gmail.com> - 2015-07-03 12:20 +0200

csiph-web