Skip to content

Commit

Permalink
iio: fix pointer cast warning
Browse files Browse the repository at this point in the history
fix compile warning reported by Fengguang Wu:

drivers/iio/light/adjd_s311.c: In function 'adjd_s311_trigger_handler':
drivers/iio/light/adjd_s311.c:188:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
drivers/iio/light/adjd_s311.c:188:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

   185              }
   186
   187              if (indio_dev->scan_timestamp)
 > 188                      *(s64 *)((phys_addr_t)data->buffer + ALIGN(len, sizeof(s64)))
   189                              = time_ns;
   190              iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns);
   191

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Peter Meerwald authored and Jonathan Cameron committed Jul 15, 2012
1 parent d291d5f commit 7958762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/light/adjd_s311.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p)
}

if (indio_dev->scan_timestamp)
*(s64 *)((phys_addr_t)data->buffer + ALIGN(len, sizeof(s64)))
*(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
= time_ns;
iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns);

Expand Down

0 comments on commit 7958762

Please sign in to comment.