linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: hid-sensor-magn-3d: Fix build warning
@ 2014-07-25 19:32 Reyad Attiyat
  2014-07-25 19:52 ` Srinivas Pandruvada
  0 siblings, 1 reply; 3+ messages in thread
From: Reyad Attiyat @ 2014-07-25 19:32 UTC (permalink / raw)
  To: jic23, srinivas.pandruvada, linux-iio, linux-kernel; +Cc: Reyad Attiyat

Fix build warning, sizeof() called on dynamically
sized pointer, by removing the call and the dependent
function parameter. It is not needed or used in this
driver, when pushing values to an iio buffer.

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 3ec777a..915ffb9 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -246,8 +246,7 @@ static const struct iio_info magn_3d_info = {
 };
 
 /* Function to push data to buffer */
-static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
-	int len)
+static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data)
 {
 	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
 	iio_push_to_buffers(indio_dev, data);
@@ -263,9 +262,7 @@ static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
 
 	dev_dbg(&indio_dev->dev, "magn_3d_proc_event\n");
 	if (atomic_read(&magn_state->common_attributes.data_ready))
-		hid_sensor_push_data(indio_dev,
-				magn_state->iio_vals,
-				sizeof(magn_state->iio_vals));
+		hid_sensor_push_data(indio_devm, magn_state->iio_vals);
 
 	return 0;
 }
-- 
1.9.3

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

* Re: [PATCH] iio: hid-sensor-magn-3d: Fix build warning
  2014-07-25 19:32 [PATCH] iio: hid-sensor-magn-3d: Fix build warning Reyad Attiyat
@ 2014-07-25 19:52 ` Srinivas Pandruvada
  2014-07-25 21:02   ` Reyad Attiyat
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Pandruvada @ 2014-07-25 19:52 UTC (permalink / raw)
  To: Reyad Attiyat; +Cc: jic23, linux-iio, linux-kernel

On 07/25/2014 12:32 PM, Reyad Attiyat wrote:
> Fix build warning, sizeof() called on dynamically
> sized pointer, by removing the call and the dependent
> function parameter. It is not needed or used in this
> driver, when pushing values to an iio buffer.
>
> Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
> ---
>   drivers/iio/magnetometer/hid-sensor-magn-3d.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> index 3ec777a..915ffb9 100644
> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> @@ -246,8 +246,7 @@ static const struct iio_info magn_3d_info = {
>   };
>
>   /* Function to push data to buffer */
> -static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
> -	int len)
> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data)
>   {
>   	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
>   	iio_push_to_buffers(indio_dev, data);
> @@ -263,9 +262,7 @@ static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
>
>   	dev_dbg(&indio_dev->dev, "magn_3d_proc_event\n");
>   	if (atomic_read(&magn_state->common_attributes.data_ready))
> -		hid_sensor_push_data(indio_dev,
> -				magn_state->iio_vals,
> -				sizeof(magn_state->iio_vals));
> +		hid_sensor_push_data(indio_devm, magn_state->iio_vals);
Is it indio_devm,  not indio_dev?

Thanks,
Srinivas
>
>   	return 0;
>   }
>


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

* Re: [PATCH] iio: hid-sensor-magn-3d: Fix build warning
  2014-07-25 19:52 ` Srinivas Pandruvada
@ 2014-07-25 21:02   ` Reyad Attiyat
  0 siblings, 0 replies; 3+ messages in thread
From: Reyad Attiyat @ 2014-07-25 21:02 UTC (permalink / raw)
  To: Srinivas Pandruvada; +Cc: Jonathan Cameron, linux-iio, linux-kernel

Whoops looks like I typed an extra character, sorry should have caught this.
Thanks Sirinivas will resend.

On Fri, Jul 25, 2014 at 2:52 PM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> On 07/25/2014 12:32 PM, Reyad Attiyat wrote:
>>
>> Fix build warning, sizeof() called on dynamically
>> sized pointer, by removing the call and the dependent
>> function parameter. It is not needed or used in this
>> driver, when pushing values to an iio buffer.
>>
>> Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
>> ---
>>   drivers/iio/magnetometer/hid-sensor-magn-3d.c | 7 ++-----
>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
>> b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
>> index 3ec777a..915ffb9 100644
>> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
>> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
>> @@ -246,8 +246,7 @@ static const struct iio_info magn_3d_info = {
>>   };
>>
>>   /* Function to push data to buffer */
>> -static void hid_sensor_push_data(struct iio_dev *indio_dev, const void
>> *data,
>> -       int len)
>> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void
>> *data)
>>   {
>>         dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
>>         iio_push_to_buffers(indio_dev, data);
>> @@ -263,9 +262,7 @@ static int magn_3d_proc_event(struct
>> hid_sensor_hub_device *hsdev,
>>
>>         dev_dbg(&indio_dev->dev, "magn_3d_proc_event\n");
>>         if (atomic_read(&magn_state->common_attributes.data_ready))
>> -               hid_sensor_push_data(indio_dev,
>> -                               magn_state->iio_vals,
>> -                               sizeof(magn_state->iio_vals));
>> +               hid_sensor_push_data(indio_devm, magn_state->iio_vals);
>
> Is it indio_devm,  not indio_dev?
>
> Thanks,
> Srinivas
>>
>>
>>         return 0;
>>   }
>>
>

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

end of thread, other threads:[~2014-07-25 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 19:32 [PATCH] iio: hid-sensor-magn-3d: Fix build warning Reyad Attiyat
2014-07-25 19:52 ` Srinivas Pandruvada
2014-07-25 21:02   ` Reyad Attiyat

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).