From patchwork Mon Jul 12 06:11:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472976 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2683714jao; Mon, 12 Jul 2021 00:24:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzBeCKnSQDEYMR50yALdkZ41BKCiQu2u8nl7ZGWYokaXF5xKVIvb8Aln+Gwly4O/590XYX X-Received: by 2002:a17:906:4ad2:: with SMTP id u18mr12805311ejt.549.1626074672231; Mon, 12 Jul 2021 00:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074672; cv=none; d=google.com; s=arc-20160816; b=v4NDRi35itcw21bbgPnkuYFZZlUSwBCwziKAJLuqNqNMFQZKEho8LMarXkjGpTETX9 8Dy5wC99WyDadCTmYF8gUkrwC0GQ5oc3bDrjRS6PCyUOykpf0v1Rvoebl0Zkmu0wpMkd ryWZF9cEdehfplvP+3KZyEZBrvPtOdpg1v/b3rgf5BukOb/8vEngfAtly/cjsiXhSfcD +HQ1azG5T9jD4D1hBLjHcG1Bth4rsR3+4YW8NMfhQA72LFTRdajjYLd1td/gYnQ5TKVi hbcQsvmpMJPkJqtCpw+GEp0zJsZO3xU5XS4GuFH3IKd2GEDHqdYsz+YFpWeA2Z59u59Z khkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p8Z/LquXoOWX2/ikMzMW0ZOGPQn3b8xmwGRVwN0qS/4=; b=YESzm8gM/aTew0+sou/3dYpQ2XK/jyxpRz0HbkPbn5De5432DtNsYTfWkeMl3lVxSZ NiVOsfHmQyggTqdMNiL6E+QzB8Zrb9pXBxd+cB59gt0junank5u2xCl7zwcqjboKBZZa uZ70/XWXgIiWZZK3x9boeB6FPKzUr75YY1+jgiGVMLtOIYPPqA0NiEEFms7JpDZ7BTHu FrcOLeY8pACfTOnPYiWGWwxzA5soBGghzgNlBrLqGJxFdLD369u7ytOO2NBxLi2aPVek tbUG3iLorIwkKDnx1ghWQNUTC7HpVB78xh+uci0x2Y3PrpnSmp/MqZij7PWb8TK8oh3l tFrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MNvHs52G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si16909677edq.169.2021.07.12.00.24.32; Mon, 12 Jul 2021 00:24:32 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MNvHs52G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245457AbhGLH1I (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345320AbhGLHZS (ORCPT ); Mon, 12 Jul 2021 03:25:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A60EA613C7; Mon, 12 Jul 2021 07:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074541; bh=p8MZCwApEeJkSMpx58w+IZ/YfyUklulrNMrzGhhLz0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNvHs52GXSvTjUQ2Ows2F9mBcGclvE7AuR1yEySq944+drikRGI36bz8qZF1GfRZs nNdSDGG8VOffI/bLNidw61MfR52HjocCNlRU1MD9YyvCvOdZXKStUhwRGXCv/gsm3y SdBpNL3DV6KtTRJ4JdtqNxl2R8FSgIOZelT3YDXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Eugen Hristev , =?utf-8?q?Nuno_S=C3=A1?= , Sasha Levin Subject: [PATCH 5.12 613/700] iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:36 +0200 Message-Id: <20210712061041.131606093@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron [ Upstream commit 8f884758966259fa8c50c137ac6d4ce9bb7859db ] 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 Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-2-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/adc/at91-sama5d2_adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 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.