All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Eugen Hristev <eugen.hristev@microchip.com>
Subject: [PATCH RESEND 1/8] iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
Date: Sun, 13 Jun 2021 16:22:54 +0100	[thread overview]
Message-ID: <20210613152301.571002-2-jic23@kernel.org> (raw)
In-Reply-To: <20210613152301.571002-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

To make code more readable, use a structure to express the channel
layout and ensure the timestamp is 8 byte aligned.

Found during an audit of all calls of this function.

Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index 6e8c28675947..ea5ca163d879 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -403,7 +403,8 @@ struct at91_adc_state {
 	struct at91_adc_dma		dma_st;
 	struct at91_adc_touch		touch_st;
 	struct iio_dev			*indio_dev;
-	u16				buffer[AT91_BUFFER_MAX_HWORDS];
+	/* Ensure naturally aligned timestamp */
+	u16				buffer[AT91_BUFFER_MAX_HWORDS] __aligned(8);
 	/*
 	 * lock to prevent concurrent 'single conversion' requests through
 	 * sysfs.
-- 
2.32.0


  reply	other threads:[~2021-06-13 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 15:22 [PATCH RESEND 0/8] IIO: Alignment fixes part 3 - __aligned(8) used to ensure alignment Jonathan Cameron
2021-06-13 15:22 ` Jonathan Cameron [this message]
2021-06-13 15:22 ` [PATCH RESEND 2/8] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Jonathan Cameron
2021-06-13 15:22 ` [PATCH RESEND 3/8] iio: adc: mxs-lradc: " Jonathan Cameron
2021-06-13 15:22 ` [PATCH RESEND 4/8] iio: adc: ti-ads8688: Fix alignment of buffer " Jonathan Cameron
2021-06-13 15:22 ` [PATCH RESEND 5/8] iio: magn: rm3100: " Jonathan Cameron
2021-06-13 15:22 ` [PATCH RESEND 6/8] iio: light: vcnl4000: Fix buffer alignment " Jonathan Cameron
2021-06-13 15:23 ` [PATCH RESEND 7/8] iio: light: vcnl4035: " Jonathan Cameron
2021-06-13 15:23 ` [PATCH RESEND 8/8] iio: prox: isl29501: " Jonathan Cameron
2021-06-14  8:03 ` [PATCH RESEND 0/8] IIO: Alignment fixes part 3 - __aligned(8) used to ensure alignment Sa, Nuno
2021-06-14 10:43   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210613152301.571002-2-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=eugen.hristev@microchip.com \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.