staging:iio:spear_adc: Fix sparse warning
Subsystems (3)
PATCH v2 1/3 staging:iio:spear_adc: Fix sparse warning
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>
---
New in v2
--- drivers/staging/iio/adc/spear_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/spear_adc.c +1 -1
@@ -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)) {
Signature · 1 line
1.8.0
PATCH v2 2/3 staging:iio:mxs-lradc: Select STMP_DEVICE
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.
---
New in v2
--- drivers/staging/iio/adc/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/iio/adc/Kconfig +1 -0
@@ -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
Signature · 1 line
1.8.0
Re: [PATCH v2 2/3] staging:iio:mxs-lradc: Select STMP_DEVICE
Quoted 8 lines · Lars-Peter Clausen
The MXS ADC driver uses the
stmp_reset_block()which is only provided when theSTMP_DEVICEKconfigsymbol is selected. Hence the driver should select this symbol. So far this has not been a problem since the driver depends onARCH_MXS, which already selectsSTMP_DEVICE, but will become necessary once we allow the driver to be built whenCOMPILE_TESTis selected.Signed-off-by Lars-Peter Clausen <[email protected]>Cc Marek Vasut <[email protected]>
Applied to the togreg branch of iio.git
Thanks,
Quoted 19 lines
---
New in v2--- drivers/staging/iio/adc/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/staging/iio/adc/Kconfig +1
-0@@ -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
PATCH v2 3/3 staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
In reply to Lars-Peter ClausenNone 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.
---
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(-)
drivers/staging/iio/adc/Kconfig +3 -3
@@ -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.
Signature · 1 line
1.8.0
Re: [PATCH v2 3/3] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
Quoted 8 lines · Lars-Peter Clausen
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_TESTis set. This makes it easier to compile test changes.Signed-off-by Lars-Peter Clausen <[email protected]>Reviewed-by Marek Vasut <[email protected]>Cc Stefan Roese <[email protected]>Cc Roland Stigge <[email protected]>
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
Quoted 39 lines
---
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(-)drivers/staging/iio/adc/Kconfig +3
-3@@ -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.
Quoted 10 lines · Lars-Peter Clausen
The driver is casting from one
__iomempointer to another. Make sure to include__iomemin 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 expressiondrivers/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 structadc_regs_spear3xx[noderef] <asn:2>*adc_base_spear3xx
drivers/staging/iio/adc/spear_adc.c:320:33: got structadc_regs_spear3xx*<noident>Signed-off-by Lars-Peter Clausen <[email protected]>Cc Stefan Roese <[email protected]>
Applied to the togreg branch of iio.git
Seems to have cleaned up that warning nicely.
Thanks Lars,
Quoted 20 lines
---
New in v2--- drivers/staging/iio/adc/spear_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/iio/adc/spear_adc.c +1
-1@@ -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)) {