Skip to contentSkip to conversation

mtd: rawnand: Improve compile-test coverage

PATCH In review Boris Brezillon 2 participants 7 messages Jul 18, 2018 – Aug 1, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover mtd: rawnand: Improve compile-test coverage

Hello,

This is an attempt at adding "depends || COMPILE_TEST" to all NAND drivers that have no compile-time dependencies on arch features/headers.

This will hopefully help us (NAND/MTD maintainers) in detecting build issues earlier. Unfortunately we still have a few drivers that can't easily be modified to be arch independent.

Regards,

Boris

Changes in v2:
- Fix a few problems reported by kbuild robots and Stephen Rothwell

Changes in v3:
- Drop depends on !IA64 since Arnd has added {read,write}s{b,w,l}() accessors to this arch
- Make sure the orion driver compiles when __LINUX_ARM_ARCH__ is not defined

Boris Brezillon (4):
mtd: rawnand: s3c2410: Allow selection of this driver when
COMPILE_TEST=y
mtd: rawnand: orion: Avoid direct inclusion of asm headers
mtd: rawnand: orion: Handle cases where __LINUX_ARM_ARCH__ is not
defined
mtd: rawnand: orion: Allow selection of this driver when
COMPILE_TEST=y

 drivers/mtd/nand/raw/Kconfig      | 6 ++++--
 drivers/mtd/nand/raw/orion_nand.c | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH v3 1/4 mtd: rawnand: s3c2410: Allow selection of this driver when COMPILE_TEST=y

It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having ARCH_S3C24XX or ARCH_S3C64XX enabled.

We add a dependency on HAS_IOMEM to make sure the driver compiles correctly.

---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +2 -1
index b6738ece16f1..03314ab8cd4d 100644
@@ -119,7 +119,8 @@ config MTD_NAND_AU1550
 
 config MTD_NAND_S3C2410
 	tristate "NAND Flash support for Samsung S3C SoCs"
-	depends on ARCH_S3C24XX || ARCH_S3C64XX
+	depends on ARCH_S3C24XX || ARCH_S3C64XX || COMPILE_TEST
+	depends on HAS_IOMEM
 	help
 	  This enables the NAND flash controller on the S3C24xx and S3C64xx
 	  SoCs
Signature · 1 line
2.14.1
#2 lore raw

PATCH v3 2/4 mtd: rawnand: orion: Avoid direct inclusion of asm headers

In reply to Boris Brezillon

Include linux/sizes.h instead of asm/sizes.h to make code completely arch independent.

---
 drivers/mtd/nand/raw/orion_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/orion_nand.c +1 -1
index 1a4828442675..27cc902545f3 100644
@@ -18,7 +18,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 #include <linux/platform_data/mtd-orion_nand.h>
 
 struct orion_nand_info {
Signature · 1 line
2.14.1
#3 lore raw

PATCH v3 3/4 mtd: rawnand: orion: Handle cases where __LINUX_ARM_ARCH__ is not defined

In reply to Boris Brezillon

Make sure __LINUX_ARM_ARCH__ is defined before testing its value. This is needed if we want to allow selection of this driver when COMPILE_TEST=y.

---
 drivers/mtd/nand/raw/orion_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/orion_nand.c +2 -2
index 27cc902545f3..52d435285a3f 100644
@@ -52,7 +52,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 {
 	struct nand_chip *chip = mtd_to_nand(mtd);
 	void __iomem *io_base = chip->IO_ADDR_R;
-#if __LINUX_ARM_ARCH__ >= 5
+#if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >= 5
 	uint64_t *buf64;
 #endif
 	int i = 0;
@@ -61,7 +61,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 		*buf++ = readb(io_base);
 		len--;
 	}
-#if __LINUX_ARM_ARCH__ >= 5
+#if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >= 5
 	buf64 = (uint64_t *)buf;
 	while (i < len/8) {
 		/*
Signature · 1 line
2.14.1
#4 lore raw

PATCH v3 4/4 mtd: rawnand: orion: Allow selection of this driver when COMPILE_TEST=y

In reply to Boris Brezillon

It just makes NAND maintainers' life easier by allowing them to compile-test this driver without having PLAT_ORION enabled.

We add a dependency on HAS_IOMEM to make sure the driver compiles correctly.

---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +2 -1
index 03314ab8cd4d..f944cf0d1017 100644
@@ -382,7 +382,8 @@ config MTD_NAND_PLATFORM
 
 config MTD_NAND_ORION
 	tristate "NAND Flash support for Marvell Orion SoC"
-	depends on PLAT_ORION
+	depends on PLAT_ORION || COMPILE_TEST
+	depends on HAS_IOMEM
 	help
 	  This enables the NAND flash controller on Orion machines.
 
Signature · 1 line
2.14.1
maintainer
#5 lore raw
In reply to Boris Brezillon

Hi Boris,

Boris Brezillon <[email protected]> wrote on Wed, 18 Jul 2018 10:56:48 +0200:

Quoted 32 lines

Hello,

This is an attempt at adding "depends || COMPILE_TEST" to all NAND drivers that have no compile-time dependencies on arch features/headers.

This will hopefully help us (NAND/MTD maintainers) in detecting build issues earlier. Unfortunately we still have a few drivers that can't easily be modified to be arch independent.

Regards,

Boris

Changes in v2:
- Fix a few problems reported by kbuild robots and Stephen Rothwell

Changes in v3:
- Drop depends on !IA64 since Arnd has added {read,write}s{b,w,l}() accessors to this arch
- Make sure the orion driver compiles when __LINUX_ARM_ARCH__ is not defined

Boris Brezillon (4):
mtd: rawnand: s3c2410: Allow selection of this driver when
COMPILE_TEST=y
mtd: rawnand: orion: Avoid direct inclusion of asm headers
mtd: rawnand: orion: Handle cases where __LINUX_ARM_ARCH__ is not
defined
mtd: rawnand: orion: Allow selection of this driver when
COMPILE_TEST=y

Quoted 4 lines
 drivers/mtd/nand/raw/Kconfig      | 6 ++++--
 drivers/mtd/nand/raw/orion_nand.c | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

Series applied to nand/next, thanks for this work that will speed up our local tests.

Miquèl

maintainer
#6 lore raw

Hello,

Miquel Raynal <[email protected]> wrote on Wed, 18 Jul 2018 23:40:10 +0200:

Quoted 37 lines

Hi Boris,

Boris Brezillon <[email protected]> wrote on Wed, 18 Jul 2018 10:56:48 +0200:

Quoted 32 lines

Hello,

This is an attempt at adding "depends || COMPILE_TEST" to all NAND drivers that have no compile-time dependencies on arch features/headers.

This will hopefully help us (NAND/MTD maintainers) in detecting build issues earlier. Unfortunately we still have a few drivers that can't easily be modified to be arch independent.

Regards,

Boris

Changes in v2:
- Fix a few problems reported by kbuild robots and Stephen Rothwell

Changes in v3:
- Drop depends on !IA64 since Arnd has added {read,write}s{b,w,l}() accessors to this arch
- Make sure the orion driver compiles when __LINUX_ARM_ARCH__ is not defined

Boris Brezillon (4):
mtd: rawnand: s3c2410: Allow selection of this driver when
COMPILE_TEST=y
mtd: rawnand: orion: Avoid direct inclusion of asm headers
mtd: rawnand: orion: Handle cases where __LINUX_ARM_ARCH__ is not
defined
mtd: rawnand: orion: Allow selection of this driver when
COMPILE_TEST=y

Quoted 7 lines
Quoted 4 lines
 drivers/mtd/nand/raw/Kconfig      | 6 ++++--
 drivers/mtd/nand/raw/orion_nand.c | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

Series applied to nand/next, thanks for this work that will speed up our local tests.

As we received build robots complaints about both orion and s3c drivers, I removed both patches to avoid build issues:

mtd: rawnand: s3c2410: Allow selection of this driver when COMPILE_TEST=y
mtd: rawnand: orion: Allow selection of this driver when COMPILE_TEST=y

Let's fix the issues and include them in the next release.

Thanks,
Miquèl