fbdev: replace dead select with dependency
PATCH v2 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.
Since the default choice is FB_BOTH_ENDIAN, let's use:
'depends on FB_LITTLE_ENDIAN || FB_BOTH_ENDIAN' to avoid breaking defconfig.
This dead select was found by kconfirm, a static analysis tool for Kconfig.
---
Changes since v1: support the default FB_BOTH_ENDIAN Link:
https://lore.kernel.org/all/[email protected]/
--- drivers/video/fbdev/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/Kconfig +1 -2
@@ -1717,8 +1717,7 @@ 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_LITTLE_ENDIAN || FB_BOTH_ENDIAN help Framebuffer support for Fujitsu Lime GDC on host CPU bus.
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Replacing `select` with `depends on` silently breaks `socrates_defconfig` and hides the Lime GDC…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Replacing select with depends on silently breaks socrates_defconfig and hides the Lime GDC driver. --
--- Patch [1]: [PATCH v2] fbdev: replace dead select with dependency --- commit bd0c1c5dd1e0309a476de7f3f80441e35d1d6474
Author: Julian Braha <[email protected]>
fbdev: replace dead select with dependency
This commit modifies the Kconfig dependencies for the Fujitsu Lime GDC framebuffer driver. It replaces the select statements for foreign and little endian support with a direct dependency on either little endian or both endians.
drivers/video/fbdev/Kconfig config FB_MB862XX_PCI_GDC · line 1720
Quoted 11 lines
drivers/video/fbdev/Kconfig +1
-2@@ -1717,8 +1717,7 @@ 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_LITTLE_ENDIAN || FB_BOTH_ENDIAN
[Severity: Medium]
Will this change cause the driver to be silently dropped in socrates_defconfig?
Looking at drivers/video/fbdev/core/Kconfig, FB_FOREIGN_ENDIAN defaults to 'n' and gates the endianness choice block:
menuconfig FB_FOREIGN_ENDIAN
bool "Framebuffer foreign endianness support" depends on FB
Since arch/powerpc/configs/85xx/socrates_defconfig requests CONFIG_FB_MB862XX_LIME=y but does not explicitly set CONFIG_FB_FOREIGN_ENDIAN=y, removing the select statement means FB_FOREIGN_ENDIAN will now evaluate to 'n'.
This hides the endianness choice block, forcing both FB_LITTLE_ENDIAN and FB_BOTH_ENDIAN to 'n'. Does this mean the new dependency will be unmet, causing the Lime GDC driver to be dropped during defconfig generation despite the commit message indicating this avoids breaking defconfig?
Quoted 2 lines
drivers/video/fbdev/Kconfig +0
-0help Framebuffer support for Fujitsu Lime GDC on host CPU bus.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 15 lines · Julian Braha
'select' does not work on config options in a 'choice', so currently it is possible to enable
FB_MB862XX_LIMEwithoutFB_LITTLE_ENDIAN.We cannot replace the 'select
FB_LITTLE_ENDIAN' without also changingFB_FOREIGN_ENDIANfrom 'select' to 'depends on', otherwise we will get a recursive dependency.Since the default choice is
FB_BOTH_ENDIAN, let's use:
'depends onFB_LITTLE_ENDIAN||FB_BOTH_ENDIAN' to avoid breaking defconfig.This dead select was found by kconfirm, a static analysis tool for
Kconfig.Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Julian Braha <[email protected]>
Quoted 7 lines
---
Changes since v1: support the defaultFB_BOTH_ENDIANLink:
https://lore.kernel.org/all/[email protected]/--- drivers/video/fbdev/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
applied.
Thanks!
Helge