All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] i2c: pmcmsp: Use proper printk format for resource_size_t
@ 2019-12-30 17:27 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pmcmsp.c: In function ‘pmcmsptwi_probe’:
    drivers/i2c/busses/i2c-pmcmsp.c:276:25: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 3 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-pmcmsp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
index 4fde74eb34a7..5d3a12bd420b 100644
--- a/drivers/i2c/busses/i2c-pmcmsp.c
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -274,8 +274,8 @@ static int pmcmsptwi_probe(struct platform_device *pldev)
 	if (!request_mem_region(res->start, resource_size(res),
 				pldev->name)) {
 		dev_err(&pldev->dev,
-			"Unable to get memory/io address region 0x%08x\n",
-			res->start);
+			"Unable to get memory/io address region %pa[p]\n",
+			&(res->start));
 		rc = -EBUSY;
 		goto ret_err;
 	}
@@ -285,7 +285,7 @@ static int pmcmsptwi_probe(struct platform_device *pldev)
 						resource_size(res));
 	if (!pmcmsptwi_data.iobase) {
 		dev_err(&pldev->dev,
-			"Unable to ioremap address 0x%08x\n", res->start);
+			"Unable to ioremap address %pa[p]\n", &(res->start));
 		rc = -EIO;
 		goto ret_unreserve;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/5] i2c: pmcmsp: Use proper printk format for resource_size_t
@ 2019-12-30 17:27 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pmcmsp.c: In function ‘pmcmsptwi_probe’:
    drivers/i2c/busses/i2c-pmcmsp.c:276:25: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 3 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-pmcmsp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c
index 4fde74eb34a7..5d3a12bd420b 100644
--- a/drivers/i2c/busses/i2c-pmcmsp.c
+++ b/drivers/i2c/busses/i2c-pmcmsp.c
@@ -274,8 +274,8 @@ static int pmcmsptwi_probe(struct platform_device *pldev)
 	if (!request_mem_region(res->start, resource_size(res),
 				pldev->name)) {
 		dev_err(&pldev->dev,
-			"Unable to get memory/io address region 0x%08x\n",
-			res->start);
+			"Unable to get memory/io address region %pa[p]\n",
+			&(res->start));
 		rc = -EBUSY;
 		goto ret_err;
 	}
@@ -285,7 +285,7 @@ static int pmcmsptwi_probe(struct platform_device *pldev)
 						resource_size(res));
 	if (!pmcmsptwi_data.iobase) {
 		dev_err(&pldev->dev,
-			"Unable to ioremap address 0x%08x\n", res->start);
+			"Unable to ioremap address %pa[p]\n", &(res->start));
 		rc = -EIO;
 		goto ret_unreserve;
 	}
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/5] i2c: pnx: Use proper printk format for resource_size_t
  2019-12-30 17:27 ` Krzysztof Kozlowski
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pnx.c: In function ‘i2c_pnx_probe’:
    drivers/i2c/busses/i2c-pnx.c:737:47: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 5 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-pnx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 6e0e546ef83f..053c35d99aad 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -734,8 +734,8 @@ static int i2c_pnx_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto out_clock;
 
-	dev_dbg(&pdev->dev, "%s: Master at %#8x, irq %d.\n",
-		alg_data->adapter.name, res->start, alg_data->irq);
+	dev_dbg(&pdev->dev, "%s: Master at %pa[p], irq %d.\n",
+		alg_data->adapter.name, &(res->start), alg_data->irq);
 
 	return 0;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/5] i2c: pnx: Use proper printk format for resource_size_t
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

resource_size_t should be printed with its own size-independent format
to fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-pnx.c: In function ‘i2c_pnx_probe’:
    drivers/i2c/busses/i2c-pnx.c:737:47: warning:
        format ‘%x’ expects argument of type ‘unsigned int’,
        but argument 5 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-pnx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 6e0e546ef83f..053c35d99aad 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -734,8 +734,8 @@ static int i2c_pnx_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto out_clock;
 
-	dev_dbg(&pdev->dev, "%s: Master at %#8x, irq %d.\n",
-		alg_data->adapter.name, res->start, alg_data->irq);
+	dev_dbg(&pdev->dev, "%s: Master at %pa[p], irq %d.\n",
+		alg_data->adapter.name, &(res->start), alg_data->irq);
 
 	return 0;
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/5] i2c: highlander: Use proper printk format for iomem pointer
  2019-12-30 17:27 ` Krzysztof Kozlowski
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
    drivers/i2c/busses/i2c-highlander.c:325:22: warning:
        format ‘%d’ expects argument of type ‘int’,
        but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-highlander.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
index abfe3094c047..803dad70e2a7 100644
--- a/drivers/i2c/busses/i2c-highlander.c
+++ b/drivers/i2c/busses/i2c-highlander.c
@@ -322,7 +322,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
 		tmp |= (SMMR_MODE0 | SMMR_MODE1);
 		break;
 	default:
-		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
+		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
 		return -EINVAL;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/5] i2c: highlander: Use proper printk format for iomem pointer
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
    drivers/i2c/busses/i2c-highlander.c:325:22: warning:
        format ‘%d’ expects argument of type ‘int’,
        but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-highlander.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
index abfe3094c047..803dad70e2a7 100644
--- a/drivers/i2c/busses/i2c-highlander.c
+++ b/drivers/i2c/busses/i2c-highlander.c
@@ -322,7 +322,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
 		tmp |= (SMMR_MODE0 | SMMR_MODE1);
 		break;
 	default:
-		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
+		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
 		return -EINVAL;
 	}
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/5] i2c: stu300: Use proper printk format for iomem pointer
  2019-12-30 17:27 ` Krzysztof Kozlowski
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-stu300.c: In function ‘stu300_wait_while_busy’:
    drivers/i2c/busses/i2c-stu300.c:446:76: warning:
        cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-stu300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 8c3e2d409d63..42e0a53e7fa4 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -444,7 +444,7 @@ static int stu300_wait_while_busy(struct stu300_dev *dev)
 		       "Attempt: %d\n", i+1);
 
 		dev_err(&dev->pdev->dev, "base address = "
-			"0x%08x, reinit hardware\n", (u32) dev->virtbase);
+			"0x%p, reinit hardware\n", dev->virtbase);
 
 		(void) stu300_init_hw(dev);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/5] i2c: stu300: Use proper printk format for iomem pointer
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-stu300.c: In function ‘stu300_wait_while_busy’:
    drivers/i2c/busses/i2c-stu300.c:446:76: warning:
        cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/i2c-stu300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 8c3e2d409d63..42e0a53e7fa4 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -444,7 +444,7 @@ static int stu300_wait_while_busy(struct stu300_dev *dev)
 		       "Attempt: %d\n", i+1);
 
 		dev_err(&dev->pdev->dev, "base address = "
-			"0x%08x, reinit hardware\n", (u32) dev->virtbase);
+			"0x%p, reinit hardware\n", dev->virtbase);
 
 		(void) stu300_init_hw(dev);
 	}
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/5] i2c: Enable compile testing for some of drivers
  2019-12-30 17:27 ` Krzysztof Kozlowski
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

Some of the I2C bus drivers can be compile tested to increase build
coverage.  This requires also:
1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
   controllers,
2. Adding 'if' conditional to 'default y' so they will not get enabled
   by default on all other architectures,
3. Limiting few compile test options to supported architectures (which
   provide the readsX()/writesX() primitives).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/Kconfig | 62 ++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 30 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 6a0aa76859f3..acb1ba635397 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
 
 config I2C_ALTERA
 	tristate "Altera Soft IP I2C"
-	depends on (ARCH_SOCFPGA || NIOS2) && OF
+	depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF
 	help
 	  If you say yes to this option, support will be included for the
 	  Altera Soft IP I2C interfaces on SoCFPGA and Nios2 architectures.
@@ -387,7 +387,7 @@ config I2C_ASPEED
 
 config I2C_AT91
 	tristate "Atmel AT91 I2C Two-Wire interface (TWI)"
-	depends on ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
 	help
 	  This supports the use of the I2C interface on Atmel AT91
 	  processors.
@@ -440,7 +440,8 @@ config I2C_AXXIA
 
 config I2C_BCM2835
 	tristate "Broadcom BCM2835 I2C controller"
-	depends on ARCH_BCM2835 || ARCH_BRCMSTB
+	depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
+	depends on COMMON_CLK
 	help
 	  If you say yes to this option, support will be included for the
 	  BCM2835 I2C controller.
@@ -463,8 +464,8 @@ config I2C_BCM_IPROC
 
 config I2C_BCM_KONA
 	tristate "BCM Kona I2C adapter"
-	depends on ARCH_BCM_MOBILE
-	default y
+	depends on ARCH_BCM_MOBILE || COMPILE_TEST
+	default y if ARCH_BCM_MOBILE
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C interface on the Broadcom Kona family of processors.
@@ -511,7 +512,7 @@ config I2C_CPM
 
 config I2C_DAVINCI
 	tristate "DaVinci I2C driver"
-	depends on ARCH_DAVINCI || ARCH_KEYSTONE
+	depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
 	help
 	  Support for TI DaVinci I2C controller driver.
 
@@ -572,7 +573,7 @@ config I2C_DESIGNWARE_BAYTRAIL
 
 config I2C_DIGICOLOR
 	tristate "Conexant Digicolor I2C driver"
-	depends on ARCH_DIGICOLOR
+	depends on ARCH_DIGICOLOR || COMPILE_TEST
 	help
 	  Support for Conexant Digicolor SoCs (CX92755) I2C controller driver.
 
@@ -611,8 +612,8 @@ config I2C_EMEV2
 
 config I2C_EXYNOS5
 	tristate "Exynos5 high-speed I2C driver"
-	depends on ARCH_EXYNOS && OF
-	default y
+	depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
+	default y if ARCH_EXYNOS
 	help
 	  High-speed I2C controller on Exynos5 based Samsung SoCs.
 
@@ -634,7 +635,7 @@ config I2C_GPIO_FAULT_INJECTOR
 
 config I2C_HIGHLANDER
 	tristate "Highlander FPGA SMBus interface"
-	depends on SH_HIGHLANDER
+	depends on SH_HIGHLANDER || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for
 	  the SMBus interface located in the FPGA on various Highlander
@@ -686,7 +687,7 @@ config I2C_IMX_LPI2C
 
 config I2C_IOP3XX
 	tristate "Intel IOPx3xx and IXP4xx on-chip I2C interface"
-	depends on ARCH_IOP32X || ARCH_IXP4XX
+	depends on ARCH_IOP32X || ARCH_IXP4XX || COMPILE_TEST
 	help
 	  Say Y here if you want to use the IIC bus controller on
 	  the Intel IOPx3xx I/O Processors or IXP4xx Network Processors.
@@ -726,6 +727,7 @@ config I2C_LPC2K
 config I2C_MESON
 	tristate "Amlogic Meson I2C controller"
 	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C interface on the Amlogic Meson family of SoCs.
@@ -759,7 +761,7 @@ config I2C_MT7621
 
 config I2C_MV64XXX
 	tristate "Marvell mv64xxx I2C Controller"
-	depends on MV64X60 || PLAT_ORION || ARCH_SUNXI || ARCH_MVEBU
+	depends on MV64X60 || PLAT_ORION || ARCH_SUNXI || ARCH_MVEBU || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for the
 	  built-in I2C interface on the Marvell 64xxx line of host bridges.
@@ -770,7 +772,7 @@ config I2C_MV64XXX
 
 config I2C_MXS
 	tristate "Freescale i.MX28 I2C interface"
-	depends on SOC_IMX28
+	depends on SOC_IMX28 || COMPILE_TEST
 	select STMP_DEVICE
 	help
 	  Say Y here if you want to use the I2C bus controller on
@@ -799,7 +801,7 @@ config I2C_OCORES
 
 config I2C_OMAP
 	tristate "OMAP I2C adapter"
-	depends on ARCH_OMAP || ARCH_K3
+	depends on ARCH_OMAP || ARCH_K3 || COMPILE_TEST
 	default y if MACH_OMAP_H3 || MACH_OMAP_OSK
 	help
 	  If you say yes to this option, support will be included for the
@@ -833,7 +835,7 @@ config I2C_PCA_PLATFORM
 
 config I2C_PMCMSP
 	tristate "PMC MSP I2C TWI Controller"
-	depends on PMC_MSP
+	depends on PMC_MSP || COMPILE_TEST
 	help
 	  This driver supports the PMC TWI controller on MSP devices.
 
@@ -842,7 +844,7 @@ config I2C_PMCMSP
 
 config I2C_PNX
 	tristate "I2C bus support for Philips PNX and NXP LPC targets"
-	depends on ARCH_LPC32XX
+	depends on ARCH_LPC32XX || COMPILE_TEST
 	help
 	  This driver supports the Philips IP3204 I2C IP block master and/or
 	  slave controller
@@ -863,7 +865,7 @@ config I2C_PUV3
 
 config I2C_PXA
 	tristate "Intel PXA2XX I2C adapter"
-	depends on ARCH_PXA || ARCH_MMP || ARCH_MVEBU || (X86_32 && PCI && OF)
+	depends on ARCH_PXA || ARCH_MMP || ARCH_MVEBU || (X86_32 && PCI && OF) || COMPILE_TEST
 	help
 	  If you have devices in the PXA I2C bus, say yes to this option.
 	  This driver can also be built as a module.  If so, the module
@@ -933,7 +935,7 @@ config HAVE_S3C2410_I2C
 
 config I2C_S3C2410
 	tristate "S3C2410 I2C Driver"
-	depends on HAVE_S3C2410_I2C
+	depends on HAVE_S3C2410_I2C || COMPILE_TEST
 	help
 	  Say Y here to include support for I2C controller in the
 	  Samsung SoCs.
@@ -971,7 +973,7 @@ config I2C_SIMTEC
 
 config I2C_SIRF
 	tristate "CSR SiRFprimaII I2C interface"
-	depends on ARCH_SIRF
+	depends on ARCH_SIRF || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for the
 	  CSR SiRFprimaII I2C interface.
@@ -981,14 +983,14 @@ config I2C_SIRF
 
 config I2C_SPRD
 	tristate "Spreadtrum I2C interface"
-	depends on I2C=y && ARCH_SPRD
+	depends on I2C=y && (ARCH_SPRD || COMPILE_TEST)
 	help
 	  If you say yes to this option, support will be included for the
 	  Spreadtrum I2C interface.
 
 config I2C_ST
 	tristate "STMicroelectronics SSC I2C support"
-	depends on ARCH_STI
+	depends on ARCH_STI || COMPILE_TEST
 	help
 	  Enable this option to add support for STMicroelectronics SoCs
 	  hardware SSC (Synchronous Serial Controller) as an I2C controller.
@@ -1019,7 +1021,7 @@ config I2C_STM32F7
 
 config I2C_STU300
 	tristate "ST Microelectronics DDC I2C interface"
-	depends on MACH_U300
+	depends on MACH_U300 || COMPILE_TEST
 	default y if MACH_U300
 	help
 	  If you say yes to this option, support will be included for the
@@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
 
 config I2C_TEGRA
 	tristate "NVIDIA Tegra internal I2C controller"
-	depends on ARCH_TEGRA
+	depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C controller embedded in NVIDIA Tegra SOCs
 
 config I2C_TEGRA_BPMP
 	tristate "NVIDIA Tegra BPMP I2C controller"
-	depends on TEGRA_BPMP
-	default y
+	depends on TEGRA_BPMP || COMPILE_TEST
+	default y if TEGRA_BPMP
 	help
 	  If you say yes to this option, support will be included for the I2C
 	  controller embedded in NVIDIA Tegra SoCs accessed via the BPMP.
@@ -1101,7 +1103,7 @@ config I2C_VERSATILE
 
 config I2C_WMT
 	tristate "Wondermedia WM8xxx SoC I2C bus support"
-	depends on ARCH_VT8500
+	depends on ARCH_VT8500 || COMPILE_TEST
 	help
 	  Say yes if you want to support the I2C bus on Wondermedia 8xxx-series
 	  SoCs.
@@ -1142,7 +1144,7 @@ config I2C_XILINX
 
 config I2C_XLR
 	tristate "Netlogic XLR and Sigma Designs I2C support"
-	depends on CPU_XLR || ARCH_TANGO
+	depends on CPU_XLR || ARCH_TANGO || COMPILE_TEST
 	help
 	  This driver enables support for the on-chip I2C interface of
 	  the Netlogic XLR/XLS MIPS processors and Sigma Designs SOCs.
@@ -1328,7 +1330,7 @@ config I2C_ICY
 
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
-	depends on X86_64
+	depends on X86_64 || COMPILE_TEST
 	help
 	  This exposes the Mellanox platform I2C busses to the linux I2C layer
 	  for X86 based systems.
@@ -1403,8 +1405,8 @@ config I2C_OPAL
 
 config I2C_ZX2967
 	tristate "ZTE ZX2967 I2C support"
-	depends on ARCH_ZX
-	default y
+	depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
+	default y if ARCH_ZX
 	help
 	  Selecting this option will add ZX2967 I2C driver.
 	  This driver can also be built as a module. If so, the module will be
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2019-12-30 17:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-30 17:27 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, linux-i2c, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski

Some of the I2C bus drivers can be compile tested to increase build
coverage.  This requires also:
1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
   controllers,
2. Adding 'if' conditional to 'default y' so they will not get enabled
   by default on all other architectures,
3. Limiting few compile test options to supported architectures (which
   provide the readsX()/writesX() primitives).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/i2c/busses/Kconfig | 62 ++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 30 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 6a0aa76859f3..acb1ba635397 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
 
 config I2C_ALTERA
 	tristate "Altera Soft IP I2C"
-	depends on (ARCH_SOCFPGA || NIOS2) && OF
+	depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF
 	help
 	  If you say yes to this option, support will be included for the
 	  Altera Soft IP I2C interfaces on SoCFPGA and Nios2 architectures.
@@ -387,7 +387,7 @@ config I2C_ASPEED
 
 config I2C_AT91
 	tristate "Atmel AT91 I2C Two-Wire interface (TWI)"
-	depends on ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
 	help
 	  This supports the use of the I2C interface on Atmel AT91
 	  processors.
@@ -440,7 +440,8 @@ config I2C_AXXIA
 
 config I2C_BCM2835
 	tristate "Broadcom BCM2835 I2C controller"
-	depends on ARCH_BCM2835 || ARCH_BRCMSTB
+	depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
+	depends on COMMON_CLK
 	help
 	  If you say yes to this option, support will be included for the
 	  BCM2835 I2C controller.
@@ -463,8 +464,8 @@ config I2C_BCM_IPROC
 
 config I2C_BCM_KONA
 	tristate "BCM Kona I2C adapter"
-	depends on ARCH_BCM_MOBILE
-	default y
+	depends on ARCH_BCM_MOBILE || COMPILE_TEST
+	default y if ARCH_BCM_MOBILE
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C interface on the Broadcom Kona family of processors.
@@ -511,7 +512,7 @@ config I2C_CPM
 
 config I2C_DAVINCI
 	tristate "DaVinci I2C driver"
-	depends on ARCH_DAVINCI || ARCH_KEYSTONE
+	depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
 	help
 	  Support for TI DaVinci I2C controller driver.
 
@@ -572,7 +573,7 @@ config I2C_DESIGNWARE_BAYTRAIL
 
 config I2C_DIGICOLOR
 	tristate "Conexant Digicolor I2C driver"
-	depends on ARCH_DIGICOLOR
+	depends on ARCH_DIGICOLOR || COMPILE_TEST
 	help
 	  Support for Conexant Digicolor SoCs (CX92755) I2C controller driver.
 
@@ -611,8 +612,8 @@ config I2C_EMEV2
 
 config I2C_EXYNOS5
 	tristate "Exynos5 high-speed I2C driver"
-	depends on ARCH_EXYNOS && OF
-	default y
+	depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
+	default y if ARCH_EXYNOS
 	help
 	  High-speed I2C controller on Exynos5 based Samsung SoCs.
 
@@ -634,7 +635,7 @@ config I2C_GPIO_FAULT_INJECTOR
 
 config I2C_HIGHLANDER
 	tristate "Highlander FPGA SMBus interface"
-	depends on SH_HIGHLANDER
+	depends on SH_HIGHLANDER || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for
 	  the SMBus interface located in the FPGA on various Highlander
@@ -686,7 +687,7 @@ config I2C_IMX_LPI2C
 
 config I2C_IOP3XX
 	tristate "Intel IOPx3xx and IXP4xx on-chip I2C interface"
-	depends on ARCH_IOP32X || ARCH_IXP4XX
+	depends on ARCH_IOP32X || ARCH_IXP4XX || COMPILE_TEST
 	help
 	  Say Y here if you want to use the IIC bus controller on
 	  the Intel IOPx3xx I/O Processors or IXP4xx Network Processors.
@@ -726,6 +727,7 @@ config I2C_LPC2K
 config I2C_MESON
 	tristate "Amlogic Meson I2C controller"
 	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C interface on the Amlogic Meson family of SoCs.
@@ -759,7 +761,7 @@ config I2C_MT7621
 
 config I2C_MV64XXX
 	tristate "Marvell mv64xxx I2C Controller"
-	depends on MV64X60 || PLAT_ORION || ARCH_SUNXI || ARCH_MVEBU
+	depends on MV64X60 || PLAT_ORION || ARCH_SUNXI || ARCH_MVEBU || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for the
 	  built-in I2C interface on the Marvell 64xxx line of host bridges.
@@ -770,7 +772,7 @@ config I2C_MV64XXX
 
 config I2C_MXS
 	tristate "Freescale i.MX28 I2C interface"
-	depends on SOC_IMX28
+	depends on SOC_IMX28 || COMPILE_TEST
 	select STMP_DEVICE
 	help
 	  Say Y here if you want to use the I2C bus controller on
@@ -799,7 +801,7 @@ config I2C_OCORES
 
 config I2C_OMAP
 	tristate "OMAP I2C adapter"
-	depends on ARCH_OMAP || ARCH_K3
+	depends on ARCH_OMAP || ARCH_K3 || COMPILE_TEST
 	default y if MACH_OMAP_H3 || MACH_OMAP_OSK
 	help
 	  If you say yes to this option, support will be included for the
@@ -833,7 +835,7 @@ config I2C_PCA_PLATFORM
 
 config I2C_PMCMSP
 	tristate "PMC MSP I2C TWI Controller"
-	depends on PMC_MSP
+	depends on PMC_MSP || COMPILE_TEST
 	help
 	  This driver supports the PMC TWI controller on MSP devices.
 
@@ -842,7 +844,7 @@ config I2C_PMCMSP
 
 config I2C_PNX
 	tristate "I2C bus support for Philips PNX and NXP LPC targets"
-	depends on ARCH_LPC32XX
+	depends on ARCH_LPC32XX || COMPILE_TEST
 	help
 	  This driver supports the Philips IP3204 I2C IP block master and/or
 	  slave controller
@@ -863,7 +865,7 @@ config I2C_PUV3
 
 config I2C_PXA
 	tristate "Intel PXA2XX I2C adapter"
-	depends on ARCH_PXA || ARCH_MMP || ARCH_MVEBU || (X86_32 && PCI && OF)
+	depends on ARCH_PXA || ARCH_MMP || ARCH_MVEBU || (X86_32 && PCI && OF) || COMPILE_TEST
 	help
 	  If you have devices in the PXA I2C bus, say yes to this option.
 	  This driver can also be built as a module.  If so, the module
@@ -933,7 +935,7 @@ config HAVE_S3C2410_I2C
 
 config I2C_S3C2410
 	tristate "S3C2410 I2C Driver"
-	depends on HAVE_S3C2410_I2C
+	depends on HAVE_S3C2410_I2C || COMPILE_TEST
 	help
 	  Say Y here to include support for I2C controller in the
 	  Samsung SoCs.
@@ -971,7 +973,7 @@ config I2C_SIMTEC
 
 config I2C_SIRF
 	tristate "CSR SiRFprimaII I2C interface"
-	depends on ARCH_SIRF
+	depends on ARCH_SIRF || COMPILE_TEST
 	help
 	  If you say yes to this option, support will be included for the
 	  CSR SiRFprimaII I2C interface.
@@ -981,14 +983,14 @@ config I2C_SIRF
 
 config I2C_SPRD
 	tristate "Spreadtrum I2C interface"
-	depends on I2C=y && ARCH_SPRD
+	depends on I2C=y && (ARCH_SPRD || COMPILE_TEST)
 	help
 	  If you say yes to this option, support will be included for the
 	  Spreadtrum I2C interface.
 
 config I2C_ST
 	tristate "STMicroelectronics SSC I2C support"
-	depends on ARCH_STI
+	depends on ARCH_STI || COMPILE_TEST
 	help
 	  Enable this option to add support for STMicroelectronics SoCs
 	  hardware SSC (Synchronous Serial Controller) as an I2C controller.
@@ -1019,7 +1021,7 @@ config I2C_STM32F7
 
 config I2C_STU300
 	tristate "ST Microelectronics DDC I2C interface"
-	depends on MACH_U300
+	depends on MACH_U300 || COMPILE_TEST
 	default y if MACH_U300
 	help
 	  If you say yes to this option, support will be included for the
@@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
 
 config I2C_TEGRA
 	tristate "NVIDIA Tegra internal I2C controller"
-	depends on ARCH_TEGRA
+	depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
 	help
 	  If you say yes to this option, support will be included for the
 	  I2C controller embedded in NVIDIA Tegra SOCs
 
 config I2C_TEGRA_BPMP
 	tristate "NVIDIA Tegra BPMP I2C controller"
-	depends on TEGRA_BPMP
-	default y
+	depends on TEGRA_BPMP || COMPILE_TEST
+	default y if TEGRA_BPMP
 	help
 	  If you say yes to this option, support will be included for the I2C
 	  controller embedded in NVIDIA Tegra SoCs accessed via the BPMP.
@@ -1101,7 +1103,7 @@ config I2C_VERSATILE
 
 config I2C_WMT
 	tristate "Wondermedia WM8xxx SoC I2C bus support"
-	depends on ARCH_VT8500
+	depends on ARCH_VT8500 || COMPILE_TEST
 	help
 	  Say yes if you want to support the I2C bus on Wondermedia 8xxx-series
 	  SoCs.
@@ -1142,7 +1144,7 @@ config I2C_XILINX
 
 config I2C_XLR
 	tristate "Netlogic XLR and Sigma Designs I2C support"
-	depends on CPU_XLR || ARCH_TANGO
+	depends on CPU_XLR || ARCH_TANGO || COMPILE_TEST
 	help
 	  This driver enables support for the on-chip I2C interface of
 	  the Netlogic XLR/XLS MIPS processors and Sigma Designs SOCs.
@@ -1328,7 +1330,7 @@ config I2C_ICY
 
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
-	depends on X86_64
+	depends on X86_64 || COMPILE_TEST
 	help
 	  This exposes the Mellanox platform I2C busses to the linux I2C layer
 	  for X86 based systems.
@@ -1403,8 +1405,8 @@ config I2C_OPAL
 
 config I2C_ZX2967
 	tristate "ZTE ZX2967 I2C support"
-	depends on ARCH_ZX
-	default y
+	depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
+	default y if ARCH_ZX
 	help
 	  Selecting this option will add ZX2967 I2C driver.
 	  This driver can also be built as a module. If so, the module will be
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
  2019-12-30 17:27   ` Krzysztof Kozlowski
  (?)
@ 2019-12-30 19:11     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 24+ messages in thread
From: Geert Uytterhoeven @ 2019-12-30 19:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, Linux I2C, Linux Kernel Mailing List, Linux ARM

Hi Krzysztof,

On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Some of the I2C bus drivers can be compile tested to increase build
> coverage.  This requires also:
> 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
>    controllers,
> 2. Adding 'if' conditional to 'default y' so they will not get enabled
>    by default on all other architectures,
> 3. Limiting few compile test options to supported architectures (which
>    provide the readsX()/writesX() primitives).
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Thanks for your patch!

> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
>
>  config I2C_ALTERA
>         tristate "Altera Soft IP I2C"
> -       depends on (ARCH_SOCFPGA || NIOS2) && OF
> +       depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF

Might be easier to read and maintain by splitting in "hard" and "useful"
dependencies:

    depends on OF
    depends on ARCH_SOCFPGA || NIOS2 || COMPILE_TEST

> @@ -611,8 +612,8 @@ config I2C_EMEV2
>
>  config I2C_EXYNOS5
>         tristate "Exynos5 high-speed I2C driver"
> -       depends on ARCH_EXYNOS && OF
> -       default y
> +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST

This means it is only useful on DT-based Exynos platforms, but compiles
everywhere?

Do you still have support for non-DT Exynos platforms?
ARCH_EXYNOS depends on ARCH_MULTI_V7?
(and its help text mentions Exynos 4/5 only, no 3?)

> @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
>
>  config I2C_TEGRA
>         tristate "NVIDIA Tegra internal I2C controller"
> -       depends on ARCH_TEGRA
> +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Perhaps

    depends on ARCH_TEGRA || COMPILE_TEST
    depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
# needs <foo>

to remember which <foo> feature is needed?

> @@ -1403,8 +1405,8 @@ config I2C_OPAL
>
>  config I2C_ZX2967
>         tristate "ZTE ZX2967 I2C support"
> -       depends on ARCH_ZX
> -       default y
> +       depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Same here/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2019-12-30 19:11     ` Geert Uytterhoeven
  0 siblings, 0 replies; 24+ messages in thread
From: Geert Uytterhoeven @ 2019-12-30 19:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

Hi Krzysztof,

On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Some of the I2C bus drivers can be compile tested to increase build
> coverage.  This requires also:
> 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
>    controllers,
> 2. Adding 'if' conditional to 'default y' so they will not get enabled
>    by default on all other architectures,
> 3. Limiting few compile test options to supported architectures (which
>    provide the readsX()/writesX() primitives).
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Thanks for your patch!

> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
>
>  config I2C_ALTERA
>         tristate "Altera Soft IP I2C"
> -       depends on (ARCH_SOCFPGA || NIOS2) && OF
> +       depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF

Might be easier to read and maintain by splitting in "hard" and "useful"
dependencies:

    depends on OF
    depends on ARCH_SOCFPGA || NIOS2 || COMPILE_TEST

> @@ -611,8 +612,8 @@ config I2C_EMEV2
>
>  config I2C_EXYNOS5
>         tristate "Exynos5 high-speed I2C driver"
> -       depends on ARCH_EXYNOS && OF
> -       default y
> +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST

This means it is only useful on DT-based Exynos platforms, but compiles
everywhere?

Do you still have support for non-DT Exynos platforms?
ARCH_EXYNOS depends on ARCH_MULTI_V7?
(and its help text mentions Exynos 4/5 only, no 3?)

> @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
>
>  config I2C_TEGRA
>         tristate "NVIDIA Tegra internal I2C controller"
> -       depends on ARCH_TEGRA
> +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Perhaps

    depends on ARCH_TEGRA || COMPILE_TEST
    depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
# needs <foo>

to remember which <foo> feature is needed?

> @@ -1403,8 +1405,8 @@ config I2C_OPAL
>
>  config I2C_ZX2967
>         tristate "ZTE ZX2967 I2C support"
> -       depends on ARCH_ZX
> -       default y
> +       depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Same here/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2019-12-30 19:11     ` Geert Uytterhoeven
  0 siblings, 0 replies; 24+ messages in thread
From: Geert Uytterhoeven @ 2019-12-30 19:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

Hi Krzysztof,

On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Some of the I2C bus drivers can be compile tested to increase build
> coverage.  This requires also:
> 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
>    controllers,
> 2. Adding 'if' conditional to 'default y' so they will not get enabled
>    by default on all other architectures,
> 3. Limiting few compile test options to supported architectures (which
>    provide the readsX()/writesX() primitives).
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Thanks for your patch!

> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
>
>  config I2C_ALTERA
>         tristate "Altera Soft IP I2C"
> -       depends on (ARCH_SOCFPGA || NIOS2) && OF
> +       depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF

Might be easier to read and maintain by splitting in "hard" and "useful"
dependencies:

    depends on OF
    depends on ARCH_SOCFPGA || NIOS2 || COMPILE_TEST

> @@ -611,8 +612,8 @@ config I2C_EMEV2
>
>  config I2C_EXYNOS5
>         tristate "Exynos5 high-speed I2C driver"
> -       depends on ARCH_EXYNOS && OF
> -       default y
> +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST

This means it is only useful on DT-based Exynos platforms, but compiles
everywhere?

Do you still have support for non-DT Exynos platforms?
ARCH_EXYNOS depends on ARCH_MULTI_V7?
(and its help text mentions Exynos 4/5 only, no 3?)

> @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
>
>  config I2C_TEGRA
>         tristate "NVIDIA Tegra internal I2C controller"
> -       depends on ARCH_TEGRA
> +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Perhaps

    depends on ARCH_TEGRA || COMPILE_TEST
    depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
# needs <foo>

to remember which <foo> feature is needed?

> @@ -1403,8 +1405,8 @@ config I2C_OPAL
>
>  config I2C_ZX2967
>         tristate "ZTE ZX2967 I2C support"
> -       depends on ARCH_ZX
> -       default y
> +       depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))

Same here/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
  2019-12-30 19:11     ` Geert Uytterhoeven
@ 2019-12-31  9:01       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-31  9:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, Linux I2C, Linux Kernel Mailing List, Linux ARM

On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > Some of the I2C bus drivers can be compile tested to increase build
> > coverage.  This requires also:
> > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> >    controllers,
> > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> >    by default on all other architectures,
> > 3. Limiting few compile test options to supported architectures (which
> >    provide the readsX()/writesX() primitives).
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> Thanks for your patch!
> 
> > --- a/drivers/i2c/busses/Kconfig
> > +++ b/drivers/i2c/busses/Kconfig
> > @@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
> >
> >  config I2C_ALTERA
> >         tristate "Altera Soft IP I2C"
> > -       depends on (ARCH_SOCFPGA || NIOS2) && OF
> > +       depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF
> 
> Might be easier to read and maintain by splitting in "hard" and "useful"
> dependencies:
> 
>     depends on OF
>     depends on ARCH_SOCFPGA || NIOS2 || COMPILE_TEST

Sure

> 
> > @@ -611,8 +612,8 @@ config I2C_EMEV2
> >
> >  config I2C_EXYNOS5
> >         tristate "Exynos5 high-speed I2C driver"
> > -       depends on ARCH_EXYNOS && OF
> > -       default y
> > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> 
> This means it is only useful on DT-based Exynos platforms, but compiles
> everywhere?

Yes. The driver will proble only from DT.

> 
> Do you still have support for non-DT Exynos platforms?
> ARCH_EXYNOS depends on ARCH_MULTI_V7?

No, only DT. I think dependency here is a left over from board times and
optional OF. Actually many drivers depend on OF and some OF-like ARCH so
it could be removed.

Since driver uses OF, it's rather the choice whether to explicitly
mention OF.

> (and its help text mentions Exynos 4/5 only, no 3?)

That's correct although it supports also Exynos7 (ARMv8) which is not
mentioned. I'll correct it.

> 
> > @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
> >
> >  config I2C_TEGRA
> >         tristate "NVIDIA Tegra internal I2C controller"
> > -       depends on ARCH_TEGRA
> > +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> 
> Perhaps
> 
>     depends on ARCH_TEGRA || COMPILE_TEST
>     depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
> # needs <foo>
> 
> to remember which <foo> feature is needed?

I can comment on <foo> but such split of archs would be confusing. One
would think that driver can work on these platforms, while it is purely
for compile testing.  Keeping it together is self-documenting: these
weird platform selection was added only for compile testing.

Best regards,
Krzysztof

> 
> > @@ -1403,8 +1405,8 @@ config I2C_OPAL
> >
> >  config I2C_ZX2967
> >         tristate "ZTE ZX2967 I2C support"
> > -       depends on ARCH_ZX
> > -       default y
> > +       depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> 
> Same here/
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2019-12-31  9:01       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-31  9:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > Some of the I2C bus drivers can be compile tested to increase build
> > coverage.  This requires also:
> > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> >    controllers,
> > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> >    by default on all other architectures,
> > 3. Limiting few compile test options to supported architectures (which
> >    provide the readsX()/writesX() primitives).
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> Thanks for your patch!
> 
> > --- a/drivers/i2c/busses/Kconfig
> > +++ b/drivers/i2c/busses/Kconfig
> > @@ -367,7 +367,7 @@ comment "I2C system bus drivers (mostly embedded / system-on-chip)"
> >
> >  config I2C_ALTERA
> >         tristate "Altera Soft IP I2C"
> > -       depends on (ARCH_SOCFPGA || NIOS2) && OF
> > +       depends on (ARCH_SOCFPGA || NIOS2 || COMPILE_TEST) && OF
> 
> Might be easier to read and maintain by splitting in "hard" and "useful"
> dependencies:
> 
>     depends on OF
>     depends on ARCH_SOCFPGA || NIOS2 || COMPILE_TEST

Sure

> 
> > @@ -611,8 +612,8 @@ config I2C_EMEV2
> >
> >  config I2C_EXYNOS5
> >         tristate "Exynos5 high-speed I2C driver"
> > -       depends on ARCH_EXYNOS && OF
> > -       default y
> > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> 
> This means it is only useful on DT-based Exynos platforms, but compiles
> everywhere?

Yes. The driver will proble only from DT.

> 
> Do you still have support for non-DT Exynos platforms?
> ARCH_EXYNOS depends on ARCH_MULTI_V7?

No, only DT. I think dependency here is a left over from board times and
optional OF. Actually many drivers depend on OF and some OF-like ARCH so
it could be removed.

Since driver uses OF, it's rather the choice whether to explicitly
mention OF.

> (and its help text mentions Exynos 4/5 only, no 3?)

That's correct although it supports also Exynos7 (ARMv8) which is not
mentioned. I'll correct it.

> 
> > @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
> >
> >  config I2C_TEGRA
> >         tristate "NVIDIA Tegra internal I2C controller"
> > -       depends on ARCH_TEGRA
> > +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> 
> Perhaps
> 
>     depends on ARCH_TEGRA || COMPILE_TEST
>     depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
> # needs <foo>
> 
> to remember which <foo> feature is needed?

I can comment on <foo> but such split of archs would be confusing. One
would think that driver can work on these platforms, while it is purely
for compile testing.  Keeping it together is self-documenting: these
weird platform selection was added only for compile testing.

Best regards,
Krzysztof

> 
> > @@ -1403,8 +1405,8 @@ config I2C_OPAL
> >
> >  config I2C_ZX2967
> >         tristate "ZTE ZX2967 I2C support"
> > -       depends on ARCH_ZX
> > -       default y
> > +       depends on ARCH_ZX || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> 
> Same here/
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
  2019-12-31  9:01       ` Krzysztof Kozlowski
@ 2019-12-31  9:20         ` Geert Uytterhoeven
  -1 siblings, 0 replies; 24+ messages in thread
From: Geert Uytterhoeven @ 2019-12-31  9:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, Linux I2C, Linux Kernel Mailing List, Linux ARM

Hi Krzysztof,

On Tue, Dec 31, 2019 at 10:01 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> > On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > Some of the I2C bus drivers can be compile tested to increase build
> > > coverage.  This requires also:
> > > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> > >    controllers,
> > > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> > >    by default on all other architectures,
> > > 3. Limiting few compile test options to supported architectures (which
> > >    provide the readsX()/writesX() primitives).
> > >
> > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

> > > @@ -611,8 +612,8 @@ config I2C_EMEV2
> > >
> > >  config I2C_EXYNOS5
> > >         tristate "Exynos5 high-speed I2C driver"
> > > -       depends on ARCH_EXYNOS && OF
> > > -       default y
> > > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> >
> > This means it is only useful on DT-based Exynos platforms, but compiles
> > everywhere?
>
> Yes. The driver will proble only from DT.
>
> >
> > Do you still have support for non-DT Exynos platforms?
> > ARCH_EXYNOS depends on ARCH_MULTI_V7?
>
> No, only DT. I think dependency here is a left over from board times and
> optional OF. Actually many drivers depend on OF and some OF-like ARCH so
> it could be removed.
>
> Since driver uses OF, it's rather the choice whether to explicitly
> mention OF.

So the !OF case is only for compile-testing.  Then it can be simplified to:

    depends on ARCH_EXYNOS || COMPILE_TEST

> > (and its help text mentions Exynos 4/5 only, no 3?)
>
> That's correct although it supports also Exynos7 (ARMv8) which is not
> mentioned. I'll correct it.

Good.

Actually "it" referred to arch/arm/mach-exynos/Kconfig:ARCH_EXYNOS,
which mentions 4/5 only, while it covers 3/4/5.

> > > @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
> > >
> > >  config I2C_TEGRA
> > >         tristate "NVIDIA Tegra internal I2C controller"
> > > -       depends on ARCH_TEGRA
> > > +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> >
> > Perhaps
> >
> >     depends on ARCH_TEGRA || COMPILE_TEST
> >     depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
> > # needs <foo>
> >
> > to remember which <foo> feature is needed?
>
> I can comment on <foo> but such split of archs would be confusing. One
> would think that driver can work on these platforms, while it is purely
> for compile testing.  Keeping it together is self-documenting: these
> weird platform selection was added only for compile testing.

Fair enough.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2019-12-31  9:20         ` Geert Uytterhoeven
  0 siblings, 0 replies; 24+ messages in thread
From: Geert Uytterhoeven @ 2019-12-31  9:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

Hi Krzysztof,

On Tue, Dec 31, 2019 at 10:01 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> > On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > Some of the I2C bus drivers can be compile tested to increase build
> > > coverage.  This requires also:
> > > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> > >    controllers,
> > > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> > >    by default on all other architectures,
> > > 3. Limiting few compile test options to supported architectures (which
> > >    provide the readsX()/writesX() primitives).
> > >
> > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

> > > @@ -611,8 +612,8 @@ config I2C_EMEV2
> > >
> > >  config I2C_EXYNOS5
> > >         tristate "Exynos5 high-speed I2C driver"
> > > -       depends on ARCH_EXYNOS && OF
> > > -       default y
> > > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> >
> > This means it is only useful on DT-based Exynos platforms, but compiles
> > everywhere?
>
> Yes. The driver will proble only from DT.
>
> >
> > Do you still have support for non-DT Exynos platforms?
> > ARCH_EXYNOS depends on ARCH_MULTI_V7?
>
> No, only DT. I think dependency here is a left over from board times and
> optional OF. Actually many drivers depend on OF and some OF-like ARCH so
> it could be removed.
>
> Since driver uses OF, it's rather the choice whether to explicitly
> mention OF.

So the !OF case is only for compile-testing.  Then it can be simplified to:

    depends on ARCH_EXYNOS || COMPILE_TEST

> > (and its help text mentions Exynos 4/5 only, no 3?)
>
> That's correct although it supports also Exynos7 (ARMv8) which is not
> mentioned. I'll correct it.

Good.

Actually "it" referred to arch/arm/mach-exynos/Kconfig:ARCH_EXYNOS,
which mentions 4/5 only, while it covers 3/4/5.

> > > @@ -1055,15 +1057,15 @@ config I2C_SYNQUACER
> > >
> > >  config I2C_TEGRA
> > >         tristate "NVIDIA Tegra internal I2C controller"
> > > -       depends on ARCH_TEGRA
> > > +       depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
> >
> > Perhaps
> >
> >     depends on ARCH_TEGRA || COMPILE_TEST
> >     depends on ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC
> > # needs <foo>
> >
> > to remember which <foo> feature is needed?
>
> I can comment on <foo> but such split of archs would be confusing. One
> would think that driver can work on these platforms, while it is purely
> for compile testing.  Keeping it together is self-documenting: these
> weird platform selection was added only for compile testing.

Fair enough.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
  2019-12-31  9:20         ` Geert Uytterhoeven
  (?)
@ 2020-01-03 13:42           ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-03 13:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Vladimir Zapolskiy, Sylvain Lemieux, Linus Walleij, Wolfram Sang,
	Jean Delvare, Jarkko Nikula, Max Staudt, Juergen Fitschen,
	Elie Morisse, Linux I2C, Linux Kernel Mailing List, Linux ARM

On Tue, Dec 31, 2019 at 10:20:01AM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Tue, Dec 31, 2019 at 10:01 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> > > On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > > Some of the I2C bus drivers can be compile tested to increase build
> > > > coverage.  This requires also:
> > > > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> > > >    controllers,
> > > > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> > > >    by default on all other architectures,
> > > > 3. Limiting few compile test options to supported architectures (which
> > > >    provide the readsX()/writesX() primitives).
> > > >
> > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> > > > @@ -611,8 +612,8 @@ config I2C_EMEV2
> > > >
> > > >  config I2C_EXYNOS5
> > > >         tristate "Exynos5 high-speed I2C driver"
> > > > -       depends on ARCH_EXYNOS && OF
> > > > -       default y
> > > > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> > >
> > > This means it is only useful on DT-based Exynos platforms, but compiles
> > > everywhere?
> >
> > Yes. The driver will proble only from DT.
> >
> > >
> > > Do you still have support for non-DT Exynos platforms?
> > > ARCH_EXYNOS depends on ARCH_MULTI_V7?
> >
> > No, only DT. I think dependency here is a left over from board times and
> > optional OF. Actually many drivers depend on OF and some OF-like ARCH so
> > it could be removed.
> >
> > Since driver uses OF, it's rather the choice whether to explicitly
> > mention OF.
> 
> So the !OF case is only for compile-testing.  Then it can be simplified to:
> 
>     depends on ARCH_EXYNOS || COMPILE_TEST
> 

Many other drivers do exactly the same: depend on ARCH_xxx (which is
already OF only) and on OF. Since OF now has all (or almost all) stubs
for !OF case, such "depends on OF" is purely from logical point of view:
the driver will not bind without OF. It will not be useful.

I do not have strong opinion about this but is there a point to change
only this one, while in all other places drivers depend on OF? It will
just bring inconsistency.

Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2020-01-03 13:42           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-03 13:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

On Tue, Dec 31, 2019 at 10:20:01AM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Tue, Dec 31, 2019 at 10:01 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> > > On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > > Some of the I2C bus drivers can be compile tested to increase build
> > > > coverage.  This requires also:
> > > > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> > > >    controllers,
> > > > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> > > >    by default on all other architectures,
> > > > 3. Limiting few compile test options to supported architectures (which
> > > >    provide the readsX()/writesX() primitives).
> > > >
> > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> > > > @@ -611,8 +612,8 @@ config I2C_EMEV2
> > > >
> > > >  config I2C_EXYNOS5
> > > >         tristate "Exynos5 high-speed I2C driver"
> > > > -       depends on ARCH_EXYNOS && OF
> > > > -       default y
> > > > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> > >
> > > This means it is only useful on DT-based Exynos platforms, but compiles
> > > everywhere?
> >
> > Yes. The driver will proble only from DT.
> >
> > >
> > > Do you still have support for non-DT Exynos platforms?
> > > ARCH_EXYNOS depends on ARCH_MULTI_V7?
> >
> > No, only DT. I think dependency here is a left over from board times and
> > optional OF. Actually many drivers depend on OF and some OF-like ARCH so
> > it could be removed.
> >
> > Since driver uses OF, it's rather the choice whether to explicitly
> > mention OF.
> 
> So the !OF case is only for compile-testing.  Then it can be simplified to:
> 
>     depends on ARCH_EXYNOS || COMPILE_TEST
> 

Many other drivers do exactly the same: depend on ARCH_xxx (which is
already OF only) and on OF. Since OF now has all (or almost all) stubs
for !OF case, such "depends on OF" is purely from logical point of view:
the driver will not bind without OF. It will not be useful.

I do not have strong opinion about this but is there a point to change
only this one, while in all other places drivers depend on OF? It will
just bring inconsistency.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 5/5] i2c: Enable compile testing for some of drivers
@ 2020-01-03 13:42           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-03 13:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux ARM, Wolfram Sang, Linus Walleij,
	Linux Kernel Mailing List, Vladimir Zapolskiy, Max Staudt,
	Elie Morisse, Jarkko Nikula, Linux I2C, Sylvain Lemieux,
	Juergen Fitschen, Jean Delvare

On Tue, Dec 31, 2019 at 10:20:01AM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Tue, Dec 31, 2019 at 10:01 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > On Mon, Dec 30, 2019 at 08:11:03PM +0100, Geert Uytterhoeven wrote:
> > > On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > > > Some of the I2C bus drivers can be compile tested to increase build
> > > > coverage.  This requires also:
> > > > 1. Adding dependencies on COMMON_CLK for BCM2835 and Meson I2C
> > > >    controllers,
> > > > 2. Adding 'if' conditional to 'default y' so they will not get enabled
> > > >    by default on all other architectures,
> > > > 3. Limiting few compile test options to supported architectures (which
> > > >    provide the readsX()/writesX() primitives).
> > > >
> > > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> > > > @@ -611,8 +612,8 @@ config I2C_EMEV2
> > > >
> > > >  config I2C_EXYNOS5
> > > >         tristate "Exynos5 high-speed I2C driver"
> > > > -       depends on ARCH_EXYNOS && OF
> > > > -       default y
> > > > +       depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> > >
> > > This means it is only useful on DT-based Exynos platforms, but compiles
> > > everywhere?
> >
> > Yes. The driver will proble only from DT.
> >
> > >
> > > Do you still have support for non-DT Exynos platforms?
> > > ARCH_EXYNOS depends on ARCH_MULTI_V7?
> >
> > No, only DT. I think dependency here is a left over from board times and
> > optional OF. Actually many drivers depend on OF and some OF-like ARCH so
> > it could be removed.
> >
> > Since driver uses OF, it's rather the choice whether to explicitly
> > mention OF.
> 
> So the !OF case is only for compile-testing.  Then it can be simplified to:
> 
>     depends on ARCH_EXYNOS || COMPILE_TEST
> 

Many other drivers do exactly the same: depend on ARCH_xxx (which is
already OF only) and on OF. Since OF now has all (or almost all) stubs
for !OF case, such "depends on OF" is purely from logical point of view:
the driver will not bind without OF. It will not be useful.

I do not have strong opinion about this but is there a point to change
only this one, while in all other places drivers depend on OF? It will
just bring inconsistency.

Best regards,
Krzysztof



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/5] i2c: stu300: Use proper printk format for iomem pointer
  2019-12-30 17:27   ` Krzysztof Kozlowski
@ 2020-01-07 10:36     ` Linus Walleij
  -1 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2020-01-07 10:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Vladimir Zapolskiy, Sylvain Lemieux, Wolfram Sang, Jean Delvare,
	Jarkko Nikula, Max Staudt, Juergen Fitschen, Elie Morisse,
	linux-i2c, linux-kernel, Linux ARM

On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:

> iomem pointers should be printed with pointer format to hide the
> actual value and fix warnings when compiling on 64-bit platform (e.g. with
> COMPILE_TEST):
>
>     drivers/i2c/busses/i2c-stu300.c: In function ‘stu300_wait_while_busy’:
>     drivers/i2c/busses/i2c-stu300.c:446:76: warning:
>         cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/5] i2c: stu300: Use proper printk format for iomem pointer
@ 2020-01-07 10:36     ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2020-01-07 10:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux ARM, Wolfram Sang, linux-kernel, Vladimir Zapolskiy,
	Max Staudt, Elie Morisse, Jarkko Nikula, linux-i2c,
	Sylvain Lemieux, Juergen Fitschen, Jean Delvare

On Mon, Dec 30, 2019 at 6:28 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:

> iomem pointers should be printed with pointer format to hide the
> actual value and fix warnings when compiling on 64-bit platform (e.g. with
> COMPILE_TEST):
>
>     drivers/i2c/busses/i2c-stu300.c: In function ‘stu300_wait_while_busy’:
>     drivers/i2c/busses/i2c-stu300.c:446:76: warning:
>         cast from pointer to integer of different size [-Wpointer-to-int-cast]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] i2c: highlander: Use proper printk format for iomem pointer
  2019-12-30 17:27   ` Krzysztof Kozlowski
@ 2020-01-07 15:08     ` Luca Ceresoli
  -1 siblings, 0 replies; 24+ messages in thread
From: Luca Ceresoli @ 2020-01-07 15:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Vladimir Zapolskiy, Sylvain Lemieux,
	Linus Walleij, Wolfram Sang, Jean Delvare, Jarkko Nikula,
	Max Staudt, Juergen Fitschen, Elie Morisse, linux-i2c,
	linux-kernel, linux-arm-kernel

Hi,

On 30/12/19 18:27, Krzysztof Kozlowski wrote:
> iomem pointers should be printed with pointer format to hide the

s/iomem/size_t/ (in the subject too)

The whole commit message needs rewording accordingly.

> actual value and fix warnings when compiling on 64-bit platform (e.g. with
> COMPILE_TEST):
> 
>     drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
>     drivers/i2c/busses/i2c-highlander.c:325:22: warning:
>         format ‘%d’ expects argument of type ‘int’,
>         but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/i2c/busses/i2c-highlander.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
> index abfe3094c047..803dad70e2a7 100644
> --- a/drivers/i2c/busses/i2c-highlander.c
> +++ b/drivers/i2c/busses/i2c-highlander.c
> @@ -322,7 +322,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
>  		tmp |= (SMMR_MODE0 | SMMR_MODE1);
>  		break;
>  	default:
> -		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
> +		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
>  		return -EINVAL;
>  	}
>  
> 

-- 
Luca

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/5] i2c: highlander: Use proper printk format for iomem pointer
@ 2020-01-07 15:08     ` Luca Ceresoli
  0 siblings, 0 replies; 24+ messages in thread
From: Luca Ceresoli @ 2020-01-07 15:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Vladimir Zapolskiy, Sylvain Lemieux,
	Linus Walleij, Wolfram Sang, Jean Delvare, Jarkko Nikula,
	Max Staudt, Juergen Fitschen, Elie Morisse, linux-i2c,
	linux-kernel, linux-arm-kernel

Hi,

On 30/12/19 18:27, Krzysztof Kozlowski wrote:
> iomem pointers should be printed with pointer format to hide the

s/iomem/size_t/ (in the subject too)

The whole commit message needs rewording accordingly.

> actual value and fix warnings when compiling on 64-bit platform (e.g. with
> COMPILE_TEST):
> 
>     drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
>     drivers/i2c/busses/i2c-highlander.c:325:22: warning:
>         format ‘%d’ expects argument of type ‘int’,
>         but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/i2c/busses/i2c-highlander.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
> index abfe3094c047..803dad70e2a7 100644
> --- a/drivers/i2c/busses/i2c-highlander.c
> +++ b/drivers/i2c/busses/i2c-highlander.c
> @@ -322,7 +322,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
>  		tmp |= (SMMR_MODE0 | SMMR_MODE1);
>  		break;
>  	default:
> -		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
> +		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
>  		return -EINVAL;
>  	}
>  
> 

-- 
Luca

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-01-07 15:08 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30 17:27 [PATCH 1/5] i2c: pmcmsp: Use proper printk format for resource_size_t Krzysztof Kozlowski
2019-12-30 17:27 ` Krzysztof Kozlowski
2019-12-30 17:27 ` [PATCH 2/5] i2c: pnx: " Krzysztof Kozlowski
2019-12-30 17:27   ` Krzysztof Kozlowski
2019-12-30 17:27 ` [PATCH 3/5] i2c: highlander: Use proper printk format for iomem pointer Krzysztof Kozlowski
2019-12-30 17:27   ` Krzysztof Kozlowski
2020-01-07 15:08   ` Luca Ceresoli
2020-01-07 15:08     ` Luca Ceresoli
2019-12-30 17:27 ` [PATCH 4/5] i2c: stu300: " Krzysztof Kozlowski
2019-12-30 17:27   ` Krzysztof Kozlowski
2020-01-07 10:36   ` Linus Walleij
2020-01-07 10:36     ` Linus Walleij
2019-12-30 17:27 ` [PATCH 5/5] i2c: Enable compile testing for some of drivers Krzysztof Kozlowski
2019-12-30 17:27   ` Krzysztof Kozlowski
2019-12-30 19:11   ` Geert Uytterhoeven
2019-12-30 19:11     ` Geert Uytterhoeven
2019-12-30 19:11     ` Geert Uytterhoeven
2019-12-31  9:01     ` Krzysztof Kozlowski
2019-12-31  9:01       ` Krzysztof Kozlowski
2019-12-31  9:20       ` Geert Uytterhoeven
2019-12-31  9:20         ` Geert Uytterhoeven
2020-01-03 13:42         ` Krzysztof Kozlowski
2020-01-03 13:42           ` Krzysztof Kozlowski
2020-01-03 13:42           ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.