[PATCH -next] mtd: spi-nor: fix artificial warning when CONFIG_MTD_CFI_Ix disable

Zeng Heng zengheng4 at huawei.com
Fri Sep 23 17:47:35 PDT 2022


Thanks for your review.

Zeng Heng

On 2022/9/23 16:16, Michael Walle wrote:
> Am 2022-09-23 03:51, schrieb Zeng Heng:
>> When CONFIG_SPI_INTEL is selected without
>> CONFIG_MTD_CFI_I[1,2,4,8] enabled, it would raise
>> compile warning as below:
>>
>> In file included from ./include/linux/mtd/spi-nor.h:10,
>>                  from drivers/spi/spi-intel.c:13:
>> ./include/linux/mtd/cfi.h:62:2:
>> error: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can
>> work. [-Werror=cpp]
>>    62 | #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support 
>> can work.
>>       |  ^~~~~~~
>>
>> "mtd/cfi.h" is introduced into "mtd/spi-nor.h" by
>> commit db4745edb282 ("mtd: spi-nor: add SPI NOR manufacturer IDs"),
>> which was already removed out since from the commit
>> d3c4bb31bf62 ("mtd: spi-nor: Drop the MFR definitions").
>>
>> After above, mtd/cfi.h is not more needed by mtd/spi-nor.h,
>> so detach the dependence.
>>
>> Fixes: d3c4bb31bf62 ("mtd: spi-nor: Drop the MFR definitions")
>> Fixes: db4745edb282 ("mtd: spi-nor: add SPI NOR manufacturer IDs")
>
> Why are there two fixes tags? If this patch is applied to
> trees which only contain the second commit, there will be a
> compile error.
>
> So it should only be
> Fixes: d3c4bb31bf62 ("mtd: spi-nor: Drop the MFR definitions")
>
> with that fixed:
> Reviewed-by: Michael Walle <michael at walle.cc>
>
> -michael



More information about the linux-mtd mailing list