[PATCH][2.3.99-pre9] arch/i386/config.in PM xconfig bug

From: Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Date: Wed May 24 2000 - 16:26:40 EST


> in the General Setup Menu, if Power Management is N, xconfig offers the
> suboptions of ACPI or APM. I identified the != "n" tests as problematic
> (since CONFIG_APM/ACPI are undefined/empty) and wrapped the entire
> section in a [ "$CONFIG_PM" != "n" ] to circumvent that problem.
>
> It my perception of the problem is correct, so is my patch. Is there
> any CodingStyle as to the indention depth for config.in? My patch uses
> 2 characters indent.

Yes, xconfig does not like != "n" conditions in some cases.
Most of the newest config fixes use indentation of 3 spaces, however there
is no documented CodingStyle in this matter.

IMHO, it would be better to use dep_* functions where possible instead of
multi level if conditions... It make config files more clear.

So version suggested by me:

--- arch/i386/config.in.old Sun May 21 10:20:52 2000
+++ arch/i386/config.in Wed May 24 22:50:55 2000
@@ -168,24 +168,18 @@
 bool 'Power Management support' CONFIG_PM
 
 dep_tristate ' ACPI support' CONFIG_ACPI $CONFIG_PM
-if [ "$CONFIG_ACPI" != "n" ]; then
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' Enter S1 for sleep (EXPERIMENTAL)' CONFIG_ACPI_S1_SLEEP
- fi
-fi
+dep_mbool ' Enter S1 for sleep (EXPERIMENTAL)' CONFIG_ACPI_S1_SLEEP $CONFIG_ACPI $CONFIG_EXPERIMENTAL
 
 dep_tristate ' Advanced Power Management BIOS support' CONFIG_APM $CONFIG_PM
-if [ "$CONFIG_APM" != "n" ]; then
- bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND
- bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE
- bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE
- bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK
- bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
- bool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE
- bool ' RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
- bool ' Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
- bool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF
-fi
+dep_mbool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND $CONFIG_APM
+dep_mbool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE $CONFIG_APM
+dep_mbool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE $CONFIG_APM
+dep_mbool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK $CONFIG_APM
+dep_mbool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND $CONFIG_APM
+dep_mbool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE $CONFIG_APM
+dep_mbool ' RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT $CONFIG_APM
+dep_mbool ' Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS $CONFIG_APM
+dep_mbool ' Use real mode APM BIOS call to power off' CONFIG_APM_REAL_MODE_POWER_OFF $CONFIG_APM
 
 endmenu
 
Regards,
     Andrzej

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

- 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 : Wed May 31 2000 - 21:00:12 EST