Skip to content

Commit f5f92b3

Browse files
arndbcomputersforpeace
authored andcommitted
mtd: cfi: enforce valid geometry configuration
MTD allows compile-time configuration of the possible CFI geometry settings that are allowed by the kernel, but that includes a couple of invalid configurations, where no bank width or no interleave setting is allowed. These are then caught with a compile-time warning: include/linux/mtd/cfi.h:76:2: warning: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. include/linux/mtd/map.h:145:2: warning: #warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work" This is a bit annoying for randconfig tests, and can be avoided if we change the Kconfig logic to always select the simplest configuration when no other one is enabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
1 parent 2c81de7 commit f5f92b3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/mtd/chips/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ endchoice
6767
config MTD_CFI_GEOMETRY
6868
bool "Specific CFI Flash geometry selection"
6969
depends on MTD_CFI_ADV_OPTIONS
70+
select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \
71+
MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \
72+
MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32)
73+
select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8)
7074
help
7175
This option does not affect the code directly, but will enable
7276
some other configuration options which would allow you to reduce

0 commit comments

Comments
 (0)