Re: A small bug with CONFIG_EXPERIMENTAL

Riley Williams (rhw@MemAlpha.CX)
Wed, 20 Oct 1999 18:00:13 +0100 (GMT)


Hi Michael.

> Tonight I noticed a small bug in some of the Config.in files
> relating to CONFIG_EXPERIMENTAL. Here is a sample of the bug:

> # fs/Config.in, line 62
> if [ "$CONFIG_SYSV_FS" != "n" -a "$CONFIG_EXPERIMENTAL" ]; then
> bool ' SYSV filesystem write support (DANGEROUS)' CONFIG_SYSV_FS_WRITE
> fi

> This code works as intended when CONFIG_EXPERIMENTAL=y. But when
> CONFIG_EXPERIMENTAL=n, this is also a non-null value!

> config, oldconfig, and menuconfig all treat this non-null value
> as true, so they enable the subsequent line. xconfig behaves as
> the Config.in author expected.

> Here is a patch which fixes all the occurrences I found. I also
> added a paragraph to the config language spec to cover this.
> Also, mconfig 0.17 already gives a warning for this construct
> ("naked word in conditional expression").

> I would be grateful if someone could check my reasoning and my
> patch before I send this to Linus.

The reasoning looks correct to me, and I just used fgrep to analyse
the entire 2.3.22 tree, with the ones you pointed out being the only
naked ones I came across.

However, I also came across a related oddity, which the following
patch appears to convert to the same usage as elsewhere:

===8<=== CUT ===>8===

--- linux-2.3.22/drivers/isdn/Config.in~ Wed Oct 13 18:32:35 1999
+++ linux-2.3.22/drivers/isdn/Config.in Wed Oct 20 17:55:13 1999
@@ -52,14 +52,14 @@
bool ' HiSax Support for Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO
bool ' HiSax Support for Gazel cards' CONFIG_HISAX_GAZEL
bool ' HiSax Support for HFC PCI-Bus cards' CONFIG_HISAX_HFC_PCI
- if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
# bool ' HiSax Support for TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
bool ' HiSax Support for Am7930' CONFIG_HISAX_AMD7930
fi
fi
fi
-if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_tristate ' Spellcaster support (EXPERIMENTAL)' CONFIG_ISDN_DRV_SC $CONFIG_ISDN
dep_tristate ' IBM Active 2000 support (EXPERIMENTAL)' CONFIG_ISDN_DRV_ACT2000 $CONFIG_ISDN
fi

===8<=== CUT ===>8===

This is the ONLY such file with this construct in related to that
variable. WHat I would like to know is whether there is any difference
between the construct used before and after that patch is applied? As
I see it, if there is a difference between the two, then the other
lines comparing "$CONFIG_EXPERIMENTAL" to "y" will also need to be
changed in the reverse way to the above.

Best wishes from Riley.

PS: The kernel versions page is now back online at the URL below, and
includes separate sublists both for each kernel series, and for
each year of development.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* http://www.memalpha.cx/Linux/Kernel/

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