linux/arch
Masahiro Yamada b9d73218d7 treewide: change conditional prompt for choices to 'depends on'
While Documentation/kbuild/kconfig-language.rst provides a brief
explanation, there are recurring confusions regarding the usage of a
prompt followed by 'if <expr>'. This conditional controls _only_ the
prompt.

A typical usage is as follows:

    menuconfig BLOCK
            bool "Enable the block layer" if EXPERT
            default y

When EXPERT=n, the prompt is hidden, but this config entry is still
active, and BLOCK is set to its default value 'y'. This is reasonable
because you are likely want to enable the block device support. When
EXPERT=y, the prompt is shown, allowing you to toggle BLOCK.

Please note that it is different from 'depends on EXPERT', which would
enable and disable the entire config entry.

However, this conditional prompt has never worked in a choice block.

The following two work in the same way: when EXPERT is disabled, the
choice block is entirely disabled.

[Test Code 1]

    choice
            prompt "choose" if EXPERT

    config A
            bool "A"

    config B
            bool "B"

    endchoice

[Test Code 2]

    choice
            prompt "choose"
            depends on EXPERT

    config A
            bool "A"

    config B
            bool "B"

    endchoice

I believe the first case should hide only the prompt, producing the
default:

   CONFIG_A=y
   # CONFIG_B is not set

The next commit will change (fix) the behavior of the conditional prompt
in choice blocks.

I see several choice blocks wrongly using a conditional prompt, where
'depends on' makes more sense.

To preserve the current behavior, this commit converts such misuses.

I did not touch the following entry in arch/x86/Kconfig:

    choice
            prompt "Memory split" if EXPERT
            default VMSPLIT_3G

This is truly the correct use of the conditional prompt; when EXPERT=n,
this choice block should silently select the reasonable VMSPLIT_3G,
although the resulting PAGE_OFFSET will not be affected anyway.

Presumably, the one in fs/jffs2/Kconfig is also correct, but I converted
it to 'depends on' to avoid any potential behavioral change.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-07-16 01:08:37 +09:00
..
alpha
arc
arm treewide: change conditional prompt for choices to 'depends on' 2024-07-16 01:08:37 +09:00
arm64 treewide: change conditional prompt for choices to 'depends on' 2024-07-16 01:08:37 +09:00
csky syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-06-25 15:57:37 +02:00
loongarch syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
m68k
microblaze syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
mips treewide: change conditional prompt for choices to 'depends on' 2024-07-16 01:08:37 +09:00
nios2
openrisc
parisc parisc: use generic sys_fanotify_mark implementation 2024-06-25 15:57:25 +02:00
powerpc treewide: change conditional prompt for choices to 'depends on' 2024-07-16 01:08:37 +09:00
riscv treewide: change conditional prompt for choices to 'depends on' 2024-07-16 01:08:37 +09:00
s390 s390: fix support for z16 systems. 2024-07-05 11:23:30 -07:00
sh sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
sparc sparc: fix compat recv/recvfrom syscalls 2024-06-25 15:57:25 +02:00
um
x86 x86-32: fix cmpxchg8b_emu build error with clang 2024-06-30 09:21:29 -07:00
xtensa
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-17 12:57:03 -07:00