This is a note to let you know that I've just added the patch titled

    staging: IIO: IMU: ADIS16400: Make sure only enabled scan_elements are 
pushed into the ring

to the 2.6.38-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     
staging-iio-imu-adis16400-make-sure-only-enabled-scan_elements-are-pushed-into-the-ring.patch
and it can be found in the queue-2.6.38 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 0fea4d6192cb82789e28905240d3c1dac6529c7c Mon Sep 17 00:00:00 2001
From: Michael Hennerich <[email protected]>
Date: Mon, 21 Mar 2011 16:44:38 +0100
Subject: staging: IIO: IMU: ADIS16400: Make sure only enabled scan_elements are 
pushed into the ring

From: Michael Hennerich <[email protected]>

commit 0fea4d6192cb82789e28905240d3c1dac6529c7c upstream.

Signed-off-by: Michael Hennerich <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/staging/iio/imu/adis16400_ring.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/staging/iio/imu/adis16400_ring.c
+++ b/drivers/staging/iio/imu/adis16400_ring.c
@@ -160,9 +160,10 @@ static void adis16400_trigger_bh_to_ring
                               work_trigger_to_ring);
        struct iio_ring_buffer *ring = st->indio_dev->ring;
 
-       int i = 0;
+       int i = 0, j;
        s16 *data;
        size_t datasize = ring->access.get_bytes_per_datum(ring);
+       unsigned long mask = ring->scan_mask;
 
        data = kmalloc(datasize , GFP_KERNEL);
        if (data == NULL) {
@@ -172,9 +173,12 @@ static void adis16400_trigger_bh_to_ring
 
        if (ring->scan_count)
                if (adis16400_spi_read_burst(&st->indio_dev->dev, st->rx) >= 0)
-                       for (; i < ring->scan_count; i++)
+                       for (; i < ring->scan_count; i++) {
+                               j = __ffs(mask);
+                               mask &= ~(1 << j);
                                data[i] = be16_to_cpup(
-                                       (__be16 *)&(st->rx[i*2]));
+                                       (__be16 *)&(st->rx[j*2]));
+                       }
 
        /* Guaranteed to be aligned with 8 byte boundary */
        if (ring->scan_timestamp)


Patches currently in stable-queue which might be from 
[email protected] are

queue-2.6.38/staging-iio-imu-adis16400-add-delay-after-self-test.patch
queue-2.6.38/staging-iio-imu-adis16400-fix-up-spi-messages-cs_change-behavior.patch
queue-2.6.38/staging-iio-imu-adis16400-fix-addresses-of-gyro-and-accel-calibration-offset.patch
queue-2.6.38/staging-iio-imu-adis16400-make-sure-only-enabled-scan_elements-are-pushed-into-the-ring.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to