linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iio: mxs-lradc: remove useless check
@ 2014-01-18 19:05 Alexandre Belloni
  2014-01-18 20:33 ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2014-01-18 19:05 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Marek Vasut, linux-iio, linux-kernel, Alexandre Belloni

Checking the channel number is useless since mxs_lradc_read_raw() is called from
a controlled environment and the driver is responsible for filing the struct
iio_chan_spec.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/staging/iio/adc/mxs-lradc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 7fc66a6a6e36..d304156ca2f7 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -897,10 +897,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
 {
 	struct mxs_lradc *lradc = iio_priv(iio_dev);
 
-	/* Check for invalid channel */
-	if (chan->channel > LRADC_MAX_TOTAL_CHANS)
-		return -EINVAL;
-
 	switch (m) {
 	case IIO_CHAN_INFO_RAW:
 		if (chan->type == IIO_TEMP)
-- 
1.8.3.2


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

* Re: [PATCH v2] iio: mxs-lradc: remove useless check
  2014-01-18 19:05 [PATCH v2] iio: mxs-lradc: remove useless check Alexandre Belloni
@ 2014-01-18 20:33 ` Marek Vasut
  2014-02-03 19:09   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2014-01-18 20:33 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: Jonathan Cameron, linux-iio, linux-kernel

On Saturday, January 18, 2014 at 08:05:18 PM, Alexandre Belloni wrote:
> Checking the channel number is useless since mxs_lradc_read_raw() is called
> from a controlled environment and the driver is responsible for filing the
> struct iio_chan_spec.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  drivers/staging/iio/adc/mxs-lradc.c | 4 ----
>  1 file changed, 4 deletions(-)

Changelog's missing ;-)

Acked-by: Marek Vasut <marex@denx.de>
 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
> b/drivers/staging/iio/adc/mxs-lradc.c index 7fc66a6a6e36..d304156ca2f7
> 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -897,10 +897,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>  {
>  	struct mxs_lradc *lradc = iio_priv(iio_dev);
> 
> -	/* Check for invalid channel */
> -	if (chan->channel > LRADC_MAX_TOTAL_CHANS)
> -		return -EINVAL;
> -
>  	switch (m) {
>  	case IIO_CHAN_INFO_RAW:
>  		if (chan->type == IIO_TEMP)

Best regards,
Marek Vasut

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

* Re: [PATCH v2] iio: mxs-lradc: remove useless check
  2014-01-18 20:33 ` Marek Vasut
@ 2014-02-03 19:09   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2014-02-03 19:09 UTC (permalink / raw)
  To: Marek Vasut, Alexandre Belloni; +Cc: linux-iio, linux-kernel



On 18/01/14 20:33, Marek Vasut wrote:
> On Saturday, January 18, 2014 at 08:05:18 PM, Alexandre Belloni wrote:
>> Checking the channel number is useless since mxs_lradc_read_raw() is called
>> from a controlled environment and the driver is responsible for filing the
>> struct iio_chan_spec.
>>
>> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> ---
>>   drivers/staging/iio/adc/mxs-lradc.c | 4 ----
>>   1 file changed, 4 deletions(-)
>
> Changelog's missing ;-)
>
> Acked-by: Marek Vasut <marex@denx.de>
Applied to the togreg branch of iio.git - will be pushed out as testing for
the autobuilders to play with it.

Thanks.
>
>> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
>> b/drivers/staging/iio/adc/mxs-lradc.c index 7fc66a6a6e36..d304156ca2f7
>> 100644
>> --- a/drivers/staging/iio/adc/mxs-lradc.c
>> +++ b/drivers/staging/iio/adc/mxs-lradc.c
>> @@ -897,10 +897,6 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>>   {
>>   	struct mxs_lradc *lradc = iio_priv(iio_dev);
>>
>> -	/* Check for invalid channel */
>> -	if (chan->channel > LRADC_MAX_TOTAL_CHANS)
>> -		return -EINVAL;
>> -
>>   	switch (m) {
>>   	case IIO_CHAN_INFO_RAW:
>>   		if (chan->type == IIO_TEMP)
>
> Best regards,
> Marek Vasut
>

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

end of thread, other threads:[~2014-02-03 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18 19:05 [PATCH v2] iio: mxs-lradc: remove useless check Alexandre Belloni
2014-01-18 20:33 ` Marek Vasut
2014-02-03 19:09   ` 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).