From patchwork Sat May 1 17:13:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12234911 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,URIBL_BLOCKED,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 C6DC0C433B4 for ; Sat, 1 May 2021 17:15:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A45046157F for ; Sat, 1 May 2021 17:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbhEARQP (ORCPT ); Sat, 1 May 2021 13:16:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbhEARQO (ORCPT ); Sat, 1 May 2021 13:16:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF0EC61574; Sat, 1 May 2021 17:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619889324; bh=+LN4Xjdak2iQoEH+UFUsB0pSejQX9aDLtcUaG++5ILI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u32M8JpzKLiq0JX/MuH5znb8K98PloF+PGNZ2HHtSp9tKENc8ttDV3sVdN5+Q2jxT GaIJc7G6rNpD8G5glQyw3mjEXgauZNgn2xr3zoivXI5UXZtLueItZslzjbMsgg+z1P AxNsHxcQIZvh01meK+j6JHfmvJ/jsn4ha/nU9lSfiSRF5sKAy+6EU4CnEybHv6Zz8y 144+ZBceX8SilmPdwIp5IHMmdcRv3O37Y58CrqAt2QpUJW8r7EzA8L2FQxFjx2i6XN jHMAyrhkjkZemQZyfZm3z0+csnFlIPOOpKq5RLsm29uNx2nMljWOAMO1AGuKUGH5j/ S6vJ5qDjpbJgg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Eugen Hristev Subject: [PATCH 01/11] iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Sat, 1 May 2021 18:13:42 +0100 Message-Id: <20210501171352.512953-2-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210501171352.512953-1-jic23@kernel.org> References: <20210501171352.512953-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 a7826f097b95..d356b515df09 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.