Over-complex config option

From: Riley Williams (rhw@MemAlpha.cx)
Date: Tue Jul 04 2000 - 18:40:23 EST


Hi Alan.

There's one config option that looks to me to be over complex as
far as the user trying to configure the Linux kernel is concerned
and I'd like to suggest that the following patch be applied to
deal with this.

Basically, the existing option is essentially a choice list, but
for some reason has been specified as an integer using magic
numbers for the associated values. I've no idea how this sneaked
in, but if magic values are to be used, they should be strictly
in the *.c and *.h files, not in the configuration scripts, at
least in my opinion.

Note also that the existing config.in file entry doesn't document
the option valued 2, but the existing *.c file entry implies that
such an option exists and is valid. I've labelled it "GodKnows"
in this patch, but if somebody can document what it really is,
that would be very much preferred...

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

--- linux-2.2.16/drivers/sound/lowlevel/Config.in~ Tue Jan 4 18:12:22 2000
+++ linux-2.2.16/drivers/sound/lowlevel/Config.in Wed Jul 5 00:29:45 2000
@@ -11,12 +11,18 @@
     fi
 
     if [ "$CONFIG_AEDSP16" = "y" -o "$CONFIG_AEDSP16" = "m" ]; then
+
         comment 'SC-6600 Audio Cards have no jumper switches at all'
         bool 'SC-6600 based audio cards (new Audio Excel DSP 16)' CONFIG_SC6600
         if [ "$CONFIG_SC6600" = "y" ]; then
             comment 'SC-6600 specific configuration'
             bool 'Activate SC-6600 Joystick Interface' CONFIG_SC6600_JOY
- int 'SC-6600 CDROM Interface (4=None, 3=IDE, 1=Panasonic, 0=?Sony?)' CONFIG_SC6600_CDROM 4
+ choice 'SC-6600 CDROM Interface' \
+ "None CONFIG_SC6600_CDROM_NONE \
+ Sony CONFIG_SC6600_CDROM_SONY \
+ Panasonic CONFIG_SC6600_CDROM_PANASONIC \
+ GodKnows CONFIG_SC6600_CDROM_GODKNOWS \
+ IDE CONFIG_SC6600_CDROM_IDE" None
             hex 'SC-6600 CDROM Interface I/O Address' CONFIG_SC6600_CDROMBASE 0
         fi
 
--- linux-2.2.16/drivers/sound/lowlevel/aedsp16.c~ Sun Aug 23 21:32:25 1998
+++ linux-2.2.16/drivers/sound/lowlevel/aedsp16.c Wed Jul 5 00:29:42 2000
@@ -648,8 +648,20 @@
 #if defined(CONFIG_SC6600_JOY)
          decoded_hcfg.joystick = CONFIG_SC6600_JOY; /* Enable */
 #endif
-#if defined(CONFIG_SC6600_CDROM)
- decoded_hcfg.cdrom = CONFIG_SC6600_CDROM; /* 4:N-3:I-2:G-1:P-0:S */
+#if defined(CONFIG_SC6600_CDROM_SONY)
+ decoded_hcfg.cdrom = 0;
+#endif
+#if defined(CONFIG_SC6600_CDROM_PANASONIC)
+ decoded_hcfg.cdrom = 1;
+#endif
+#if defined(CONFIG_SC6600_CDROM_GODKNOWS)
+ decoded_hcfg.cdrom = 2;
+#endif
+#if defined(CONFIG_SC6600_CDROM_IDE)
+ decoded_hcfg.cdrom = 3;
+#endif
+#if defined(CONFIG_SC6600_CDROM_NONE)
+ decoded_hcfg.cdrom = 4;
 #endif
 #if defined(CONFIG_SC6600_CDROMBASE)
         decoded_hcfg.cdrombase = CONFIG_SC6600_CDROMBASE; /* 0 Disable */

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

Best wishes from Riley.

 * Copyright (C) 2000, Memory Alpha Systems.
 * All rights and wrongs reserved.

+----------------------------------------------------------------------+
| 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/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:16 EST