Skip to contentSkip to conversation

Remove side-effects of CONFIG_EXPERT

PATCH NAK David Herrmann 3 participants 10 messages May 13, 2012 – May 14, 2012

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

cover Remove side-effects of CONFIG_EXPERT

CONFIG_EXPERT was designed to toggle visibility of config options. However, we used it in several different places to change default values or default selections. This may produce unwanted side-effects for users who enable EXPERT mode to toggle a single config option.

Regards
David

David Herrmann (7):
HID: Do not switch default values in EXPERT mode
Media: Do not change default values in EXPERT mode
rfkill: Do not change default values in EXPERT mode
Kconfig: Do not switch default values in EXPERT mode
usb: remove unneeded default value
pcmcia: Do not change selected options in EXPERT mode
drm: do not change selected options based on EXPERT mode

 drivers/gpu/drm/Kconfig             |    1 -
 drivers/gpu/drm/nouveau/Kconfig     |    1 -
 drivers/hid/Kconfig                 |   30 +++++++++++++++---------------
 drivers/media/common/tuners/Kconfig |    1 -
 drivers/media/dvb/frontends/Kconfig |    1 -
 drivers/media/video/Kconfig         |    2 +-
 drivers/pcmcia/Kconfig              |    1 -
 drivers/usb/core/Kconfig            |    1 -
 init/Kconfig                        |    2 +-
 net/rfkill/Kconfig                  |    2 +-
 usr/Kconfig                         |    8 ++++----
 11 files changed, 22 insertions(+), 28 deletions(-)
Signature · 1 line
1.7.10.2
#1 lore raw

PATCH 1/7 HID: Do not switch default values in EXPERT mode

Expert mode was designed to toggle visibility of options and not to change their behavior. If a user wants to tweak a single value and enables EXPERT mode to do this, he will have several unexpected side effects when other subsystems toggle their default values based on EXPERT mode. This makes EXPERT pretty useless.

---
 drivers/hid/Kconfig |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/hid/Kconfig +15 -15
index ffddcba..ce21ea1 100644
@@ -63,7 +63,7 @@ menu "Special HID drivers"
 config HID_A4TECH
 	tristate "A4 tech mice" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for A4 tech X5 and WOP-35 / Trust 450L mice.
 
@@ -84,7 +84,7 @@ config HID_ACRUX_FF
 config HID_APPLE
 	tristate "Apple {i,Power,Mac}Books" if EXPERT
 	depends on (USB_HID || BT_HIDP)
-	default !EXPERT
+	default y
 	---help---
 	Support for some Apple devices which less or more break
 	HID specification.
@@ -95,21 +95,21 @@ config HID_APPLE
 config HID_BELKIN
 	tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Belkin Flip KVM and Wireless keyboard.
 
 config HID_CHERRY
 	tristate "Cherry Cymotion keyboard" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Cherry Cymotion keyboard.
 
 config HID_CHICONY
 	tristate "Chicony Tactical pad" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Chicony Tactical pad.
 
@@ -131,7 +131,7 @@ config HID_PRODIKEYS
 config HID_CYPRESS
 	tristate "Cypress mouse and barcode readers" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for cypress mouse and barcode readers.
 
@@ -173,7 +173,7 @@ config HID_ELECOM
 config HID_EZKEY
 	tristate "Ezkey BTC 8193 keyboard" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Ezkey BTC 8193 keyboard.
 
@@ -236,7 +236,7 @@ config HID_TWINHAN
 config HID_KENSINGTON
 	tristate "Kensington Slimblade Trackball" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Kensington Slimblade Trackball.
 
@@ -249,7 +249,7 @@ config HID_LCPOWER
 config HID_LOGITECH
 	tristate "Logitech devices" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Logitech devices that are not fully compliant with HID standard.
 
@@ -325,14 +325,14 @@ config HID_MAGICMOUSE
 config HID_MICROSOFT
 	tristate "Microsoft non-fully HID-compliant devices" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Microsoft devices that are not fully compliant with HID standard.
 
 config HID_MONTEREY
 	tristate "Monterey Genius KB29E keyboard" if EXPERT
 	depends on USB_HID
-	default !EXPERT
+	default y
 	---help---
 	Support for Monterey Genius KB29E.
 
@@ -438,7 +438,7 @@ config HID_PICOLCD
 
 config HID_PICOLCD_FB
 	bool "Framebuffer support" if EXPERT
-	default !EXPERT
+	default y
 	depends on HID_PICOLCD
 	depends on HID_PICOLCD=FB || FB=y
 	select FB_DEFERRED_IO
@@ -452,7 +452,7 @@ config HID_PICOLCD_FB
 
 config HID_PICOLCD_BACKLIGHT
 	bool "Backlight control" if EXPERT
-	default !EXPERT
+	default y
 	depends on HID_PICOLCD
 	depends on HID_PICOLCD=BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=y
 	---help---
@@ -461,7 +461,7 @@ config HID_PICOLCD_BACKLIGHT
 
 config HID_PICOLCD_LCD
 	bool "Contrast control" if EXPERT
-	default !EXPERT
+	default y
 	depends on HID_PICOLCD
 	depends on HID_PICOLCD=LCD_CLASS_DEVICE || LCD_CLASS_DEVICE=y
 	---help---
@@ -469,7 +469,7 @@ config HID_PICOLCD_LCD
 
 config HID_PICOLCD_LEDS
 	bool "GPO via leds class" if EXPERT
-	default !EXPERT
+	default y
 	depends on HID_PICOLCD
 	depends on HID_PICOLCD=LEDS_CLASS || LEDS_CLASS=y
 	---help---
Signature · 1 line
1.7.10.2
#2 lore raw

Re: [PATCH 1/7] HID: Do not switch default values in EXPERT mode

Quoted 8 lines · David Herrmann

Expert mode was designed to toggle visibility of options and not to change their behavior. If a user wants to tweak a single value and enables EXPERT mode to do this, he will have several unexpected side effects when other subsystems toggle their default values based on EXPERT mode. This makes EXPERT pretty useless.

Please see

	d04b431e3d769fbbf26c4f4072002375c8cc4ed9
	b36299bcc0feae4c1bcff6a1561b8beb635e9c80

for some reasoning why this is done the way it's done.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#3 lore raw

PATCH 2/7 Media: Do not change default values in EXPERT mode

In reply to David Herrmann

Expert mode was designed to toggle visibility of options and not to change their behavior. If a user wants to tweak a single value and enables EXPERT mode to do this, he will have several unexpected side effects when other subsystems toggle their default values based on EXPERT mode. This makes EXPERT pretty useless.

Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/common/tuners/Kconfig |    1 -
 drivers/media/dvb/frontends/Kconfig |    1 -
 drivers/media/video/Kconfig         |    2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)
drivers/media/common/tuners/Kconfig +0 -1
index 4a6d5ce..0bb2956 100644
@@ -35,7 +35,6 @@ config MEDIA_TUNER
 config MEDIA_TUNER_CUSTOMISE
 	bool "Customize analog and hybrid tuner modules to build"
 	depends on MEDIA_TUNER
-	default y if EXPERT
 	help
 	  This allows the user to deselect tuner drivers unnecessary
 	  for their hardware from the build. Use this option with care
drivers/media/dvb/frontends/Kconfig +0 -1
index 2124670..1b0c854 100644
@@ -1,7 +1,6 @@
 config DVB_FE_CUSTOMISE
 	bool "Customise the frontend modules to build"
 	depends on DVB_CORE
-	default y if EXPERT
 	help
 	  This allows the user to select/deselect frontend drivers for their
 	  hardware from the build.
drivers/media/video/Kconfig +1 -1
index ce1e7ba..843d317 100644
@@ -100,7 +100,7 @@ config VIDEO_FIXED_MINOR_RANGES
 
 config VIDEO_HELPER_CHIPS_AUTO
 	bool "Autoselect pertinent encoders/decoders and other helper chips"
-	default y if !EXPERT
+	default y
 	---help---
 	  Most video cards may require additional modules to encode or
 	  decode audio/video standards. This option will autoselect
Signature · 1 line
1.7.10.2
#4 lore raw

PATCH 3/7 rfkill: Do not change default values in EXPERT mode

In reply to David Herrmann

Expert mode was designed to toggle visibility of options and not to change their behavior. If a user wants to tweak a single value and enables EXPERT mode to do this, he will have several unexpected side effects when other subsystems toggle their default values based on EXPERT mode. This makes EXPERT pretty useless.

---
 net/rfkill/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/rfkill/Kconfig +1 -1
index 78efe89..3d96f42 100644
@@ -21,7 +21,7 @@ config RFKILL_INPUT
 	bool "RF switch input support" if EXPERT
 	depends on RFKILL
 	depends on INPUT = y || RFKILL = INPUT
-	default y if !EXPERT
+	default y
 
 config RFKILL_REGULATOR
 	tristate "Generic rfkill regulator driver"
Signature · 1 line
1.7.10.2
#5 lore raw

PATCH 4/7 Kconfig: Do not switch default values in EXPERT mode

In reply to David Herrmann

We should avoid changing default values when EXPERT mode is enabled. Often users enable EXPERT mode to change a single value. If other subsystems change their defaults in EXPERT mode, the user might get a totally different result as expected.

---
 init/Kconfig |    2 +-
 usr/Kconfig  |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
init/Kconfig +1 -1
index 6cfd71d..f16400d 100644
@@ -801,7 +801,7 @@ config CHECKPOINT_RESTORE
 
 menuconfig NAMESPACES
 	bool "Namespaces support" if EXPERT
-	default !EXPERT
+	default y
 	help
 	  Provides the way to make tasks work with different objects using
 	  the same id. For example same IPC id may refer to different objects
usr/Kconfig +4 -4
index 65b845b..065a0e3 100644
@@ -56,7 +56,7 @@ config RD_GZIP
 
 config RD_BZIP2
 	bool "Support initial ramdisks compressed using bzip2" if EXPERT
-	default !EXPERT
+	default y
 	depends on BLK_DEV_INITRD
 	select DECOMPRESS_BZIP2
 	help
@@ -65,7 +65,7 @@ config RD_BZIP2
 
 config RD_LZMA
 	bool "Support initial ramdisks compressed using LZMA" if EXPERT
-	default !EXPERT
+	default y
 	depends on BLK_DEV_INITRD
 	select DECOMPRESS_LZMA
 	help
@@ -74,7 +74,7 @@ config RD_LZMA
 
 config RD_XZ
 	bool "Support initial ramdisks compressed using XZ" if EXPERT
-	default !EXPERT
+	default y
 	depends on BLK_DEV_INITRD
 	select DECOMPRESS_XZ
 	help
@@ -83,7 +83,7 @@ config RD_XZ
 
 config RD_LZO
 	bool "Support initial ramdisks compressed using LZO" if EXPERT
-	default !EXPERT
+	default y
 	depends on BLK_DEV_INITRD
 	select DECOMPRESS_LZO
 	help
Signature · 1 line
1.7.10.2
#6 lore raw

PATCH 5/7 usb: remove unneeded default value

In reply to David Herrmann

If no default value is specified, then 'n' is used so the default value used here is not needed. Furthermore, we should never change default values depending on EXPERT mode. EXPERT mode should only make options visible, not change them.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/core/Kconfig |    1 -
 1 file changed, 1 deletion(-)
drivers/usb/core/Kconfig +0 -1
index 18d02e3..04aec50 100644
@@ -125,7 +125,6 @@ config USB_OTG_WHITELIST
 	bool "Rely on OTG Targeted Peripherals List"
 	depends on USB_OTG || EXPERT
 	default y if USB_OTG
-	default n if EXPERT
 	help
 	  If you say Y here, the "otg_whitelist.h" file will be used as a
 	  product whitelist, so USB peripherals not listed there will be
Signature · 1 line
1.7.10.2
#7 lore raw

PATCH 6/7 pcmcia: Do not change selected options in EXPERT mode

In reply to David Herrmann

EXPERT mode is supposed to toggle the visibility of config options, it should never modify them, though. If users enable EXPERT mode to change a single value, they might get unwanted side-effects with our current behavior.

---
 drivers/pcmcia/Kconfig |    1 -
 1 file changed, 1 deletion(-)
drivers/pcmcia/Kconfig +0 -1
index bba3ab2..ef0dbf9 100644
@@ -69,7 +69,6 @@ comment "PC-card bridges"
 config YENTA
 	tristate "CardBus yenta-compatible bridge support"
 	depends on PCI
-	select CARDBUS if !EXPERT
 	select PCCARD_NONSTATIC if PCMCIA != n
 	---help---
 	  This option enables support for CardBus host bridges.  Virtually
Signature · 1 line
1.7.10.2
#8 lore raw

PATCH 7/7 drm: do not change selected options based on EXPERT mode

In reply to David Herrmann

EXPERT mode is designed to toggle visibility of config options. It should not have any other effect on config values. Imagine if a user wants to tweak a single value that is protected by EXPERT mode. If they enable EXPERT mode to change that single option, they might get side effects from other subsystems which they didn't expect. This makes EXPERT mode totally useless. Hence, simply let the user always select the framebuffer-console manually.
Furthermore, with kmscon or wayland, users might want to disable CONFIG_VT which is currently automatically selected by DRM_KMS_HELPER through FRAMEBUFFER_CONSOLE if !EXPERT.

---
 drivers/gpu/drm/Kconfig         |    1 -
 drivers/gpu/drm/nouveau/Kconfig |    1 -
 2 files changed, 2 deletions(-)
drivers/gpu/drm/Kconfig +0 -1
index e354bc0..ded991c 100644
@@ -28,7 +28,6 @@ config DRM_KMS_HELPER
 	tristate
 	depends on DRM
 	select FB
-	select FRAMEBUFFER_CONSOLE if !EXPERT
 	select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
 	help
 	  FB and CRTC helpers for KMS drivers.
drivers/gpu/drm/nouveau/Kconfig +0 -1
index 97a8126..d7e2536 100644
@@ -8,7 +8,6 @@ config DRM_NOUVEAU
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select FB
-	select FRAMEBUFFER_CONSOLE if !EXPERT
 	select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
 	select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
 	select ACPI_WMI if ACPI
Signature · 1 line
1.7.10.2
#9 lore raw

Re: [PATCH 7/7] drm: do not change selected options based on EXPERT mode

Quoted 11 lines

EXPERT mode is designed to toggle visibility of config options. It should not have any other effect on config values. Imagine if a user wants to tweak a single value that is protected by EXPERT mode. If they enable EXPERT mode to change that single option, they might get side effects from other subsystems which they didn't expect. This makes EXPERT mode totally useless. Hence, simply let the user always select the framebuffer-console manually.
Furthermore, with kmscon or wayland, users might want to disable CONFIG_VT which is currently automatically selected by DRM_KMS_HELPER through FRAMEBUFFER_CONSOLE if !EXPERT.

NAK,

not going to happen, the whole point is that we get FRAMEBUFFER_CONSOLE selected, the number of bugs filed where people build kernels with kms and forget the console is why we did this, it would be stupid to undo it.

The !EXPERT thing was added just for the kmscon/wayland use case, where some expert was configuring the kernel.

Dave.