Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbbKWNk2 (ORCPT ); Mon, 23 Nov 2015 08:40:28 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:54803 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbbKWNkZ (ORCPT ); Mon, 23 Nov 2015 08:40:25 -0500 From: Arnd Bergmann To: Brian Norris , linux-mtd@lists.infradead.org Cc: David Woodhouse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] mtd: cfi: enforce valid geometry configuration Date: Mon, 23 Nov 2015 14:39:33 +0100 Message-ID: <3747078.dk5V5gxuXa@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:nsb7M7T3S5kkRy7WYD/9GMdov7gthsg4+8+0XaxB8moDDvU1Y9N 5Tzor4BBSkaiBYqfGz4nsEFKDTOBAmjcMx+jp4SHmqSBoZ8THHFmikEAitkCopNSNb1dHWS Gc3DbcHu2QtJBNLxde4nsS/xMYdHGX8EFToEdVFyt4Yg9+pQ/qAGF9voGfJw0bloP4cNpvd Q+04zKiY4D9hQqRp66Z2g== X-UI-Out-Filterresults: notjunk:1;V01:K0:4uR8pa/JBek=:h9eSsvmprsZ20Tj0mPxxaO XHw64/1Um4AEQQrYmPnYsEAQ7PQ6VuYLI2hNogMPciVm5maim2SDjtFclRz5zIa8gdfpJ/28f PuPMyO4Sn6Tz8tQMIO9OP2MnDoY0P65q6ZiwbjzKJcbro1B3ndPFp5kEDQFSN3DSQZiE8o7/z VqIwYIGUohXB4rANeNqK/LTMP1sEGrtiMim3peViErhLLCRpMt59oV8iqPaReMZlXp1GT8Hnx G/SqIbeFrV+jGde4Oj1gtSDm3qfcrEokJGF6S52bMVd7l27xGZAFsUEDcuWVpmSN0sQbZgwNV JK0NzC90yxozQilax5fFXjD5VEw3Hg58qjW+Yan5Ah9vpRIQ8noXQ5tZa3PxIHqJTcEFkqtxp gxCOSJswT5er6yU/xQndaXkQp2+JbdPSphquKwqfhg2wn8OXB2zY0EQdywDep/Fg10Kk0d1D4 gUsqfWGGCPrPVm+hsuF1BKIa23FL3r9OTDoei/nQre4FZGDaaZz0DhVcf0dnQGh3Q7rzjuQ0o A665+QyH/L7ecRH+ZY9R+FWRRuhzBAYK2T+w4qg/NE/PZzV8AmyRPJufNrhZeBXKftEym5+B9 u7zTlsZVvlMyxkkOgFuKScRIqlxBFf4vjsobsXHEwyk5i6er5/Ru3ifCNgTcRATM39PhPTPWZ ksUSVwEI2JoTmQIAPthxVytuOJ6OPxIX6pMf2d2J7tMQ3OtNyPzf07pVnqsQuUqsqVbKWt0nI W05yxdL/ndKYDTrT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1647 Lines: 35 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 diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index 63b6b536b044..741ec69e0b46 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -69,6 +69,10 @@ endchoice config MTD_CFI_GEOMETRY bool "Specific CFI Flash geometry selection" depends on MTD_CFI_ADV_OPTIONS + select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \ + MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \ + MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32) + select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8) help This option does not affect the code directly, but will enable some other configuration options which would allow you to reduce -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/