* [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning
@ 2013-10-12 13:55 Lars-Peter Clausen
2013-10-12 13:55 ` [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE Lars-Peter Clausen
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-10-12 13:55 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen, Stefan Roese
The driver is casting from one __iomem pointer to another. Make sure to include
__iomem in the cast, otherwise sparse will complain with the following warning:
drivers/staging/iio/adc/spear_adc.c:321:18: warning: cast removes address space of expression
drivers/staging/iio/adc/spear_adc.c:320:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/iio/adc/spear_adc.c:320:33: expected struct adc_regs_spear3xx [noderef] <asn:2>*adc_base_spear3xx
drivers/staging/iio/adc/spear_adc.c:320:33: got struct adc_regs_spear3xx *<noident>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Stefan Roese <sr@denx.de>
---
New in v2
---
drivers/staging/iio/adc/spear_adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
index fc99598..e6555b6 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -318,7 +318,7 @@ static int spear_adc_probe(struct platform_device *pdev)
return -ENOMEM;
}
info->adc_base_spear3xx =
- (struct adc_regs_spear3xx *)info->adc_base_spear6xx;
+ (struct adc_regs_spear3xx __iomem *)info->adc_base_spear6xx;
info->clk = clk_get(dev, NULL);
if (IS_ERR(info->clk)) {
--
1.8.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE
2013-10-12 13:55 [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Lars-Peter Clausen
@ 2013-10-12 13:55 ` Lars-Peter Clausen
2013-10-14 22:14 ` Jonathan Cameron
2013-10-12 13:55 ` [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
2013-10-14 22:14 ` [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Jonathan Cameron
2 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-10-12 13:55 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen, Marek Vasut
The MXS ADC driver uses the stmp_reset_block() which is only provided when the
STMP_DEVICE Kconfig symbol is selected. Hence the driver should select this
symbol. So far this has not been a problem since the driver depends on ARCH_MXS,
which already selects STMP_DEVICE, but will become necessary once we allow the
driver to be built when COMPILE_TEST is selected.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Marek Vasut <marex@denx.de>
---
New in v2
---
drivers/staging/iio/adc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index cabc7a3..52d92a1 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -114,6 +114,7 @@ config LPC32XX_ADC
config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
depends on ARCH_MXS
+ select STMP_DEVICE
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
--
1.8.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE
2013-10-12 13:55 ` [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE Lars-Peter Clausen
@ 2013-10-14 22:14 ` Jonathan Cameron
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-10-14 22:14 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio, Marek Vasut
On 10/12/13 14:55, Lars-Peter Clausen wrote:
> The MXS ADC driver uses the stmp_reset_block() which is only provided when the
> STMP_DEVICE Kconfig symbol is selected. Hence the driver should select this
> symbol. So far this has not been a problem since the driver depends on ARCH_MXS,
> which already selects STMP_DEVICE, but will become necessary once we allow the
> driver to be built when COMPILE_TEST is selected.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Marek Vasut <marex@denx.de>
Applied to the togreg branch of iio.git
Thanks,
> ---
> New in v2
> ---
> drivers/staging/iio/adc/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
> index cabc7a3..52d92a1 100644
> --- a/drivers/staging/iio/adc/Kconfig
> +++ b/drivers/staging/iio/adc/Kconfig
> @@ -114,6 +114,7 @@ config LPC32XX_ADC
> config MXS_LRADC
> tristate "Freescale i.MX23/i.MX28 LRADC"
> depends on ARCH_MXS
> + select STMP_DEVICE
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
> help
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
2013-10-12 13:55 [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Lars-Peter Clausen
2013-10-12 13:55 ` [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE Lars-Peter Clausen
@ 2013-10-12 13:55 ` Lars-Peter Clausen
2013-10-14 22:15 ` Jonathan Cameron
2013-10-14 22:14 ` [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Jonathan Cameron
2 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-10-12 13:55 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-iio, Lars-Peter Clausen, Stefan Roese, Roland Stigge
None of the SPEAr, LPC32XX or MXS ADC drivers have a compile time dependency on
their respective platform. So make it possible to build the drivers when
CONFIG_COMPILE_TEST is set. This makes it easier to compile test changes.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Roland Stigge <stigge@antcom.de>
---
No changes in v2, but fixed up a linker error and a sparse warning in patch 1
and 2 in this series.
---
drivers/staging/iio/adc/Kconfig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 52d92a1..1cf4764 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -102,7 +102,7 @@ config AD7280
config LPC32XX_ADC
tristate "NXP LPC32XX ADC"
- depends on ARCH_LPC32XX
+ depends on ARCH_LPC32XX || COMPILE_TEST
help
Say yes here to build support for the integrated ADC inside the
LPC32XX SoC. Note that this feature uses the same hardware as the
@@ -113,7 +113,7 @@ config LPC32XX_ADC
config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
- depends on ARCH_MXS
+ depends on ARCH_MXS || COMPILE_TEST
select STMP_DEVICE
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
@@ -126,7 +126,7 @@ config MXS_LRADC
config SPEAR_ADC
tristate "ST SPEAr ADC"
- depends on PLAT_SPEAR
+ depends on PLAT_SPEAR || COMPILE_TEST
help
Say yes here to build support for the integrated ADC inside the
ST SPEAr SoC. Provides direct access via sysfs.
--
1.8.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
2013-10-12 13:55 ` [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
@ 2013-10-14 22:15 ` Jonathan Cameron
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-10-14 22:15 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio, Stefan Roese, Roland Stigge
On 10/12/13 14:55, Lars-Peter Clausen wrote:
> None of the SPEAr, LPC32XX or MXS ADC drivers have a compile time dependency on
> their respective platform. So make it possible to build the drivers when
> CONFIG_COMPILE_TEST is set. This makes it easier to compile test changes.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Reviewed-by: Marek Vasut <marex@denx.de>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Roland Stigge <stigge@antcom.de>
Applied to the togreg branch of iio.git
Thanks. Definitely nice to be able to build test these without rumaging around
for suitable config :)
Jonathan
> ---
> No changes in v2, but fixed up a linker error and a sparse warning in patch 1
> and 2 in this series.
> ---
> drivers/staging/iio/adc/Kconfig | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
> index 52d92a1..1cf4764 100644
> --- a/drivers/staging/iio/adc/Kconfig
> +++ b/drivers/staging/iio/adc/Kconfig
> @@ -102,7 +102,7 @@ config AD7280
>
> config LPC32XX_ADC
> tristate "NXP LPC32XX ADC"
> - depends on ARCH_LPC32XX
> + depends on ARCH_LPC32XX || COMPILE_TEST
> help
> Say yes here to build support for the integrated ADC inside the
> LPC32XX SoC. Note that this feature uses the same hardware as the
> @@ -113,7 +113,7 @@ config LPC32XX_ADC
>
> config MXS_LRADC
> tristate "Freescale i.MX23/i.MX28 LRADC"
> - depends on ARCH_MXS
> + depends on ARCH_MXS || COMPILE_TEST
> select STMP_DEVICE
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
> @@ -126,7 +126,7 @@ config MXS_LRADC
>
> config SPEAR_ADC
> tristate "ST SPEAr ADC"
> - depends on PLAT_SPEAR
> + depends on PLAT_SPEAR || COMPILE_TEST
> help
> Say yes here to build support for the integrated ADC inside the
> ST SPEAr SoC. Provides direct access via sysfs.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning
2013-10-12 13:55 [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Lars-Peter Clausen
2013-10-12 13:55 ` [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE Lars-Peter Clausen
2013-10-12 13:55 ` [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
@ 2013-10-14 22:14 ` Jonathan Cameron
2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-10-14 22:14 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio, Stefan Roese
On 10/12/13 14:55, Lars-Peter Clausen wrote:
> The driver is casting from one __iomem pointer to another. Make sure to include
> __iomem in the cast, otherwise sparse will complain with the following warning:
>
> drivers/staging/iio/adc/spear_adc.c:321:18: warning: cast removes address space of expression
> drivers/staging/iio/adc/spear_adc.c:320:33: warning: incorrect type in assignment (different address spaces)
> drivers/staging/iio/adc/spear_adc.c:320:33: expected struct adc_regs_spear3xx [noderef] <asn:2>*adc_base_spear3xx
> drivers/staging/iio/adc/spear_adc.c:320:33: got struct adc_regs_spear3xx *<noident>
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Stefan Roese <sr@denx.de>
Applied to the togreg branch of iio.git
Seems to have cleaned up that warning nicely.
Thanks Lars,
> ---
> New in v2
> ---
> drivers/staging/iio/adc/spear_adc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
> index fc99598..e6555b6 100644
> --- a/drivers/staging/iio/adc/spear_adc.c
> +++ b/drivers/staging/iio/adc/spear_adc.c
> @@ -318,7 +318,7 @@ static int spear_adc_probe(struct platform_device *pdev)
> return -ENOMEM;
> }
> info->adc_base_spear3xx =
> - (struct adc_regs_spear3xx *)info->adc_base_spear6xx;
> + (struct adc_regs_spear3xx __iomem *)info->adc_base_spear6xx;
>
> info->clk = clk_get(dev, NULL);
> if (IS_ERR(info->clk)) {
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-14 21:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12 13:55 [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Lars-Peter Clausen
2013-10-12 13:55 ` [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE Lars-Peter Clausen
2013-10-14 22:14 ` Jonathan Cameron
2013-10-12 13:55 ` [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
2013-10-14 22:15 ` Jonathan Cameron
2013-10-14 22:14 ` [PATCH v2 1/3] staging:iio:spear_adc: Fix sparse warning Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).