staging: iio: simplify timestamp alignment in iio_simple_dummy
authorPeter Meerwald <pmeerw@pmeerw.net>
Fri, 22 Jun 2012 07:47:42 +0000 (09:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jun 2012 04:24:27 +0000 (21:24 -0700)
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/iio_simple_dummy_buffer.c

index d91196021c0d52c7dc4f48ccefd7bf01d73deaf8..f4415da528a74985d52160da3fc0adf0a34593f5 100644 (file)
@@ -85,8 +85,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
        }
        /* Store a timestampe at an 8 byte boundary */
        if (indio_dev->scan_timestamp)
-               *(s64 *)(((phys_addr_t)data + len
-                               + sizeof(s64) - 1) & ~(sizeof(s64) - 1))
+               *(s64 *)((phys_addr_t)data + ALIGN(len, sizeof(s64)))
                        = iio_get_time_ns();
        buffer->access->store_to(buffer, (u8 *)data, pf->timestamp);