From patchwork Sun Jun 13 15:22:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12317751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E8F0C48BE8 for ; Sun, 13 Jun 2021 15:21:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39ECC61358 for ; Sun, 13 Jun 2021 15:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbhFMPXO (ORCPT ); Sun, 13 Jun 2021 11:23:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbhFMPXO (ORCPT ); Sun, 13 Jun 2021 11:23:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C31E661285; Sun, 13 Jun 2021 15:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623597672; bh=A2mZSbX/BRRKhma5z072BPclMFGaJIcuWPhmZbCWk0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D56jp3mmGxdduPvRmaq57RD/8/G5qNZX1IP+KGA65yhprOCzxoDJrrlAAPc82xZr2 czb66l2ZuYzBHcuE/43XZfxu9TXfrFHaLcu7aPfhx20Zzfn6f4SL1p8UsFRkFtNoY3 2x9YxB43feBD3GPPdD38FQjXiibUFzAyMKF9CJgNDWnUwvJNMALUslYG2WBfAct7Vj yWAP6J9pAVSIVoBon06WbnmjnnMLP2rRn9kKLW5/pn2yZRrUJEv+49+do3CENUNEK4 myt4F/jRFMyfoHVrG0+GiWLIJOpZ/JUr1hNKo0E+1hwx/JKYRSYZBNM2k3PYkeyIqQ X5eeqO2DQEAIg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Eugen Hristev 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 Message-Id: <20210613152301.571002-2-jic23@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210613152301.571002-1-jic23@kernel.org> References: <20210613152301.571002-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron 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 Cc: Eugen Hristev --- 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.