Skip to contentSkip to conversation

fbdev: replace dead select with dependency

PATCH Superseded Julian Braha 3 participants 3 messages Jul 22 – Jul 23 Framebuffer layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: replace dead select with dependency

'select' does not work on config options in a 'choice', so currently it is possible to enable FB_MB862XX_LIME without FB_LITTLE_ENDIAN.

We cannot replace the 'select FB_LITTLE_ENDIAN' without also changing FB_FOREIGN_ENDIAN from 'select' to 'depends on', otherwise we will get a recursive dependency.

Note that, if we remove the select / dependency, the kernel will compile with FB_MB862XX_LIME=y and FB_LITTLE_ENDIAN=n so if it would be better to remove the select, please advise as I do not have the hardware to runtime test this.

This dead select was found by kconfirm, a static analysis tool for Kconfig.

---
 drivers/video/fbdev/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/Kconfig +2 -2
index 085d3a202148..1ed4506c0cb2 100644
@@ -1717,8 +1717,8 @@ config FB_MB862XX_PCI_GDC
 config FB_MB862XX_LIME
 	bool "Lime GDC"
 	depends on OF && PPC
-	select FB_FOREIGN_ENDIAN
-	select FB_LITTLE_ENDIAN
+	depends on FB_FOREIGN_ENDIAN
+	depends on FB_LITTLE_ENDIAN
 	help
 	  Framebuffer support for Fujitsu Lime GDC on host CPU bus.
 
Signature · 1 line
2.54.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Changing `select` to `depends on` for `FB_FOREIGN_ENDIAN` and `FB_LITTLE_ENDIAN` breaks defconfigs…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Changing select to depends on for FB_FOREIGN_ENDIAN and FB_LITTLE_ENDIAN breaks defconfigs and hides the driver under the default FB_BOTH_ENDIAN configuration. --

--- Patch [1]: [PATCH] fbdev: replace dead select with dependency --- commit f6c60088df30f6a2f86ba2d49417608f5f3983b3
Author: Julian Braha <[email protected]>

fbdev: replace dead select with dependency

This commit modifies the Kconfig entry for FB_MB862XX_LIME, replacing the select statements for FB_FOREIGN_ENDIAN and FB_LITTLE_ENDIAN with depends on statements. This is intended to fix a dead select on a choice option without creating recursive dependencies.

drivers/video/fbdev/Kconfig config FB_MB862XX_PCI_GDC · line 1721

Quoted 12 lines
drivers/video/fbdev/Kconfig +2 -2
index 085d3a202148b..1ed4506c0cb2e 100644
@@ -1717,8 +1717,8 @@ config FB_MB862XX_PCI_GDC
 config FB_MB862XX_LIME
 	bool "Lime GDC"
 	depends on OF && PPC
-	select FB_FOREIGN_ENDIAN
-	select FB_LITTLE_ENDIAN
+	depends on FB_FOREIGN_ENDIAN
+	depends on FB_LITTLE_ENDIAN

[Severity: High]
Does changing these to 'depends on' inadvertently disable the driver for existing defconfigs and users of the default FB_BOTH_ENDIAN choice?

For example, arch/powerpc/configs/85xx/socrates_defconfig contains:

CONFIG_FB_MB862XX_LIME=y

Because the defconfig does not explicitly enable FB_FOREIGN_ENDIAN, won't this new dependency cause the configuration system to silently drop the driver from the build?

Additionally, if a user selects FB_BOTH_ENDIAN (the default for the choice), FB_LITTLE_ENDIAN becomes 'n'.

Does this make the driver unselectable even though FB_BOTH_ENDIAN should satisfy the endianness requirements?

Quoted 2 lines
drivers/video/fbdev/Kconfig +0 -0
 	help
 	  Framebuffer support for Fujitsu Lime GDC on host CPU bus.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Julian Braha
Quoted 5 lines · Julian Braha
drivers/video/fbdev/Kconfig +0 -0
index 085d3a202148..1ed4506c0cb2 100644

drivers/video/fbdev/Kconfig config FB_MB862XX_PCI_GDC · line 1723

Quoted 9 lines
drivers/video/fbdev/Kconfig +2 -2
@@ -1717,8 +1717,8 @@ config FB_MB862XX_PCI_GDC
 config FB_MB862XX_LIME
 	bool "Lime GDC"
 	depends on OF && PPC
-	select FB_FOREIGN_ENDIAN
-	select FB_LITTLE_ENDIAN
+	depends on FB_FOREIGN_ENDIAN
+	depends on FB_LITTLE_ENDIAN
 	help
 	  Framebuffer support for Fujitsu Lime GDC on host CPU bus.

I would make this one

       select FB_FOREIGN_ENDIAN
       depends on FB_LITTLE_ENDIAN || FB_BOTH_ENDIAN

to avoid breanking defconfig files. The default choice is FB_BOTH_ENDIAN, and that should work fine here.

Arnd