linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging:iio:spear_adc: Remove unused variable
@ 2013-10-07 13:26 Lars-Peter Clausen
  2013-10-07 13:26 ` [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
  2013-10-12 12:33 ` [PATCH 1/2] staging:iio:spear_adc: Remove unused variable Jonathan Cameron
  0 siblings, 2 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2013-10-07 13:26 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen, Stefan Roese

Remove the scale_mv variable from the read_raw() callback. Fixes the following
warning:
	drivers/staging/iio/adc/spear_adc.c: In function 'spear_read_raw':
	drivers/staging/iio/adc/spear_adc.c:149:6: warning: unused variable 'scale_mv'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Stefan Roese <sr@denx.de>
---
 drivers/staging/iio/adc/spear_adc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
index 657e01b..fc99598 100644
--- a/drivers/staging/iio/adc/spear_adc.c
+++ b/drivers/staging/iio/adc/spear_adc.c
@@ -146,7 +146,6 @@ static int spear_read_raw(struct iio_dev *indio_dev,
 			  long mask)
 {
 	struct spear_adc_info *info = iio_priv(indio_dev);
-	u32 scale_mv;
 	u32 status;
 
 	switch (mask) {
-- 
1.8.0


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

* [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
  2013-10-07 13:26 [PATCH 1/2] staging:iio:spear_adc: Remove unused variable Lars-Peter Clausen
@ 2013-10-07 13:26 ` Lars-Peter Clausen
  2013-10-07 13:27   ` Lars-Peter Clausen
  2013-10-12 12:33 ` [PATCH 1/2] staging:iio:spear_adc: Remove unused variable Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2013-10-07 13:26 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>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek Vasut <marex@denx.de
Cc: Roland Stigge <stigge@antcom.de>
---
 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 cabc7a3..58af3ae 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 IIO_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	help
@@ -125,7 +125,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] 7+ messages in thread

* Re: [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
  2013-10-07 13:26 ` [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
@ 2013-10-07 13:27   ` Lars-Peter Clausen
  2013-10-07 14:35     ` Marek Vasut
  0 siblings, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2013-10-07 13:27 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Jonathan Cameron, linux-iio, Stefan Roese, Roland Stigge,
	Marek Vasut

On 10/07/2013 03:26 PM, 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>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Marek Vasut <marex@denx.de

Missing > here, added Marek to Cc manually

> Cc: Roland Stigge <stigge@antcom.de>
> ---
>  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 cabc7a3..58af3ae 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 IIO_BUFFER
>  	select IIO_TRIGGERED_BUFFER
>  	help
> @@ -125,7 +125,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] 7+ messages in thread

* Re: [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
  2013-10-07 13:27   ` Lars-Peter Clausen
@ 2013-10-07 14:35     ` Marek Vasut
  2013-10-12 12:33       ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2013-10-07 14:35 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Jonathan Cameron, linux-iio, Stefan Roese, Roland Stigge

Dear Lars-Peter Clausen,

> On 10/07/2013 03:26 PM, 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>
> > Cc: Stefan Roese <sr@denx.de>
> > Cc: Marek Vasut <marex@denx.de
> 
> Missing > here, added Marek to Cc manually

Thanks. Makes sense to me

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

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

* Re: [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
  2013-10-12 12:33       ` Jonathan Cameron
@ 2013-10-12 11:53         ` Lars-Peter Clausen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2013-10-12 11:53 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Marek Vasut, linux-iio, Stefan Roese, Roland Stigge

On 10/12/2013 02:33 PM, Jonathan Cameron wrote:
> On 10/07/13 15:35, Marek Vasut wrote:
>> Dear Lars-Peter Clausen,
>>
>>> On 10/07/2013 03:26 PM, 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.
>>>>
> 
> I'm getting a ERROR: "stmp_reset_block" [drivers/staging/iio/adc/mxs-lradc.ko] undefined!

It's called CONFIG_COMPILE_TEST for a reason and not CONFIG_LINK_TEST ;) Ok,
I guess I should have not been lazy and actually also link tested. It looks
as if the driver needs to select the STMP_DEVICE symbol in it's Kconfig
entry. It is automatically selected by ARCH_MXS, so we didn't see the error
before, but other drivers using that function also select the Kconfig
symbol, so I think it is the right thing to do. I'll add a patch which adds
the select and then resend the series.

> 
> Also for reference also the following warnings from a build with sparse enabled.
> 
>   CHECK   drivers/staging/iio/adc/mxs-lradc.c
> 
> drivers/staging/iio/adc/mxs-lradc.c:1298:25: warning: incorrect type in argument 1 (different address spaces)
> drivers/staging/iio/adc/mxs-lradc.c:1298:25:    expected void const *ptr
> drivers/staging/iio/adc/mxs-lradc.c:1298:25:    got void [noderef] <asn:2>*base
> drivers/staging/iio/adc/mxs-lradc.c:1299:37: warning: incorrect type in argument 1 (different address spaces)
> drivers/staging/iio/adc/mxs-lradc.c:1299:37:    expected void const *ptr
> drivers/staging/iio/adc/mxs-lradc.c:1299:37:    got void [noderef] <asn:2>*base 

The one above will be gone after you updated your sparse installation to the
latest version.

>   CC [M]  drivers/staging/iio/adc/mxs-lradc.o
>   CHECK   drivers/staging/iio/adc/spear_adc.c
> 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>
> 

This one is a bit ugly as it used a struct to access io mapped registers.
The sparse warning can be eliminated though by annotating the struct pointer
with __iomem.

- Lars

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

* Re: [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set
  2013-10-07 14:35     ` Marek Vasut
@ 2013-10-12 12:33       ` Jonathan Cameron
  2013-10-12 11:53         ` Lars-Peter Clausen
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2013-10-12 12:33 UTC (permalink / raw)
  To: Marek Vasut, Lars-Peter Clausen; +Cc: linux-iio, Stefan Roese, Roland Stigge

On 10/07/13 15:35, Marek Vasut wrote:
> Dear Lars-Peter Clausen,
> 
>> On 10/07/2013 03:26 PM, 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.
>>>

I'm getting a ERROR: "stmp_reset_block" [drivers/staging/iio/adc/mxs-lradc.ko] undefined!

Also for reference also the following warnings from a build with sparse enabled.

  CHECK   drivers/staging/iio/adc/mxs-lradc.c

drivers/staging/iio/adc/mxs-lradc.c:1298:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/iio/adc/mxs-lradc.c:1298:25:    expected void const *ptr
drivers/staging/iio/adc/mxs-lradc.c:1298:25:    got void [noderef] <asn:2>*base
drivers/staging/iio/adc/mxs-lradc.c:1299:37: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/iio/adc/mxs-lradc.c:1299:37:    expected void const *ptr
drivers/staging/iio/adc/mxs-lradc.c:1299:37:    got void [noderef] <asn:2>*base
  CC [M]  drivers/staging/iio/adc/mxs-lradc.o
  CHECK   drivers/staging/iio/adc/spear_adc.c
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>


I haven't even glanced at what caused these as yet.

>>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>>> Cc: Stefan Roese <sr@denx.de>
>>> Cc: Marek Vasut <marex@denx.de
>>
>> Missing > here, added Marek to Cc manually
> 
> Thanks. Makes sense to me
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
> 
> Best regards,
> Marek Vasut
> 


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

* Re: [PATCH 1/2] staging:iio:spear_adc: Remove unused variable
  2013-10-07 13:26 [PATCH 1/2] staging:iio:spear_adc: Remove unused variable Lars-Peter Clausen
  2013-10-07 13:26 ` [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
@ 2013-10-12 12:33 ` Jonathan Cameron
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2013-10-12 12:33 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio, Stefan Roese

On 10/07/13 14:26, Lars-Peter Clausen wrote:
> Remove the scale_mv variable from the read_raw() callback. Fixes the following
> warning:
> 	drivers/staging/iio/adc/spear_adc.c: In function 'spear_read_raw':
> 	drivers/staging/iio/adc/spear_adc.c:149:6: warning: unused variable 'scale_mv'
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Stefan Roese <sr@denx.de>
Applied to the togreg branch of iio.git

Thanks.
> ---
>  drivers/staging/iio/adc/spear_adc.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c
> index 657e01b..fc99598 100644
> --- a/drivers/staging/iio/adc/spear_adc.c
> +++ b/drivers/staging/iio/adc/spear_adc.c
> @@ -146,7 +146,6 @@ static int spear_read_raw(struct iio_dev *indio_dev,
>  			  long mask)
>  {
>  	struct spear_adc_info *info = iio_priv(indio_dev);
> -	u32 scale_mv;
>  	u32 status;
>  
>  	switch (mask) {
> 

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

end of thread, other threads:[~2013-10-12 11:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 13:26 [PATCH 1/2] staging:iio:spear_adc: Remove unused variable Lars-Peter Clausen
2013-10-07 13:26 ` [PATCH 2/2] staging:iio: Allow to build SoC specific drivers when COMPILE_TEST is set Lars-Peter Clausen
2013-10-07 13:27   ` Lars-Peter Clausen
2013-10-07 14:35     ` Marek Vasut
2013-10-12 12:33       ` Jonathan Cameron
2013-10-12 11:53         ` Lars-Peter Clausen
2013-10-12 12:33 ` [PATCH 1/2] staging:iio:spear_adc: Remove unused variable 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).