From patchwork Mon Jul 12 06:11:33 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: 472878 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2649130jao; Sun, 11 Jul 2021 23:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcXZHQWnhVkP+KOtGyfri5z6VAwfP4NVf/Y2OPzkau2XQGSnbm70Yx/YUBvBH6VK6eQZYi X-Received: by 2002:a17:906:478b:: with SMTP id cw11mr49922977ejc.241.1626071414522; Sun, 11 Jul 2021 23:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071414; cv=none; d=google.com; s=arc-20160816; b=GeqZy4zQKLoefkgvniX2Oepk+L99FZnItEAPhi+DDPO9PX5F79+iDjV6R5Wv/zw7Iu vYaDAyTddi5ZNRJdZh3IvtbU/rAlVo3KNGcIzjr4gh7/veHildUVNF07nzHIkyDbkLMt ZxWtZOCqIsw6K4Ar5KarHz1AbdOBT1CacSEBqPXZ6+6F9MbEOy1BPXOhlDpZBk4wiuhM rG5QHEBkauP0E79VYD01QG71vBZRYzNx6DondupDAc3DfuS7ti0Cz1/sT8MsK95pL9rc NturjZfbtOx9qbe3k0E8LLtyYzX2NZ+om7aAZnfele6kTin2SiBAPc7zBU51JyVbJJ+f 7aoQ== 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=m9tfHTIfjW+Yp5S3kD9nvLdgOadPQmQkxgxQUjGYK0Y=; b=yFMvdEFCZc9iO/YiAsnMlTU113db2mHds7rGtORU2GyuatzKAueP0o9lLyPQIlfpH8 PdGy4oUlvyRYMzxLUbromcV/suOOhz0Thk9abZNW1DQE4lBqW3Cu3IYkCg6fyxwpppWT XfCGlVH2m4y/SmOV0WyjY0LyopBSw6OUYOLp27l96oH/0bJAO4RYS+FCs/86Oif2e0nn A7e+cv/2koIYE+ggDigolq9Y4TU+qiDm6YUrUzrHz8Dg6a3+tiJi6UWmYCAKVbwHCnwl InWQtCZB6dlErakeYT7MlGuGMPsY8z4Uido15wLIeXyR3Y+reDpcfme1vLOcm9pOnb7I /1Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qbwdrjyi; 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 bz6si16420285ejc.610.2021.07.11.23.30.14; Sun, 11 Jul 2021 23:30:14 -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=qbwdrjyi; 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 S235870AbhGLGc4 (ORCPT + 12 others); Mon, 12 Jul 2021 02:32:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235937AbhGLG3j (ORCPT ); Mon, 12 Jul 2021 02:29:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16CAD61220; Mon, 12 Jul 2021 06:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071179; bh=MDrTT/x/uO+BCIL15MppzblgtLmQojlElPsIKghW8mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbwdrjyiAxV8HL3JlDxZ0mVpR7hNfKCh0mSu3xKpPQnem6dxRXNKXCESX091Cslkr GsYgeu6dgnJQLWzCnoo9uOyEaKSQ7VTMfYlRR2LRGBTu7dCKOYDewzif5W62wBfz/2 MnnFTsfxNjbSHLtm8B2XTeijVDql/hJE3VIJlLrE= 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.4 309/348] iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:33 +0200 Message-Id: <20210712060744.838644727@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 bafb9dded0ea..def4abeb47ca 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -400,7 +400,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.