linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] iio: common: remove unnecessary sizeof(u8)
@ 2014-11-16 12:33 Fabian Frederick
  2014-11-22  1:26 ` Hartmut Knaack
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-11-16 12:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, linux-iio

sizeof(u8) is always 1.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/iio/common/st_sensors/st_sensors_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
index 78a6a1a..5b37737 100644
--- a/drivers/iio/common/st_sensors/st_sensors_spi.c
+++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
@@ -54,7 +54,7 @@ static int st_sensors_spi_read(struct st_sensor_transfer_buffer *tb,
 	if (err)
 		goto acc_spi_read_error;
 
-	memcpy(data, tb->rx_buf, len*sizeof(u8));
+	memcpy(data, tb->rx_buf, len);
 	mutex_unlock(&tb->buf_lock);
 	return len;
 
-- 
1.9.3


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

* Re: [PATCH 1/1 linux-next] iio: common: remove unnecessary sizeof(u8)
  2014-11-16 12:33 [PATCH 1/1 linux-next] iio: common: remove unnecessary sizeof(u8) Fabian Frederick
@ 2014-11-22  1:26 ` Hartmut Knaack
  2014-11-22 12:07   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Knaack @ 2014-11-22  1:26 UTC (permalink / raw)
  To: Fabian Frederick, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald, linux-iio

Fabian Frederick schrieb am 16.11.2014 13:33:
> sizeof(u8) is always 1.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
>  drivers/iio/common/st_sensors/st_sensors_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
> index 78a6a1a..5b37737 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_spi.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
> @@ -54,7 +54,7 @@ static int st_sensors_spi_read(struct st_sensor_transfer_buffer *tb,
>  	if (err)
>  		goto acc_spi_read_error;
>  
> -	memcpy(data, tb->rx_buf, len*sizeof(u8));
> +	memcpy(data, tb->rx_buf, len);
>  	mutex_unlock(&tb->buf_lock);
>  	return len;
>  
> 


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

* Re: [PATCH 1/1 linux-next] iio: common: remove unnecessary sizeof(u8)
  2014-11-22  1:26 ` Hartmut Knaack
@ 2014-11-22 12:07   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2014-11-22 12:07 UTC (permalink / raw)
  To: Hartmut Knaack, Fabian Frederick, linux-kernel
  Cc: Lars-Peter Clausen, Peter Meerwald, linux-iio

On 22/11/14 01:26, Hartmut Knaack wrote:
> Fabian Frederick schrieb am 16.11.2014 13:33:
>> sizeof(u8) is always 1.
>>
>> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Applied to the togreg branch of iio.git - initially pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
>> ---
>>  drivers/iio/common/st_sensors/st_sensors_spi.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
>> index 78a6a1a..5b37737 100644
>> --- a/drivers/iio/common/st_sensors/st_sensors_spi.c
>> +++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
>> @@ -54,7 +54,7 @@ static int st_sensors_spi_read(struct st_sensor_transfer_buffer *tb,
>>  	if (err)
>>  		goto acc_spi_read_error;
>>  
>> -	memcpy(data, tb->rx_buf, len*sizeof(u8));
>> +	memcpy(data, tb->rx_buf, len);
>>  	mutex_unlock(&tb->buf_lock);
>>  	return len;
>>  
>>
> 


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

end of thread, other threads:[~2014-11-22 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-16 12:33 [PATCH 1/1 linux-next] iio: common: remove unnecessary sizeof(u8) Fabian Frederick
2014-11-22  1:26 ` Hartmut Knaack
2014-11-22 12:07   ` 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).