staging:iio:kfifo remove entirely pointless code.
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 26 Oct 2011 16:27:40 +0000 (17:27 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 00:30:30 +0000 (16:30 -0800)
I really don't want to think about how this bit got
in there.  It allocates some storage - copies something
into it then frees it without making use of it.
Oops.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/kfifo_buf.c

index e8c234bb18f0bffefbb3aa21b177eb00cf5381c3..fd98a0ebb5ff099a889091ecb5d24c924a9b76ed 100644 (file)
@@ -150,16 +150,9 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
 {
        int ret;
        struct iio_kfifo *kf = iio_to_kfifo(r);
-       u8 *datal = kmalloc(r->bytes_per_datum, GFP_KERNEL);
-       memcpy(datal, data, r->bytes_per_datum - sizeof(timestamp));
-       memcpy(datal + r->bytes_per_datum - sizeof(timestamp),
-               &timestamp, sizeof(timestamp));
        ret = kfifo_in(&kf->kf, data, r->bytes_per_datum);
-       if (ret != r->bytes_per_datum) {
-               kfree(datal);
+       if (ret != r->bytes_per_datum)
                return -EBUSY;
-       }
-       kfree(datal);
        return 0;
 }