From patchwork Mon Jul 12 06:11:35 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: 472877 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2648939jao; Sun, 11 Jul 2021 23:31:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJJnwfwaJSmt1WiMEBavyfSHecHwn37K+gv3rTYeVGFnFllhdJSWYhdFtU5j+3hkZXKK02 X-Received: by 2002:a05:6402:548:: with SMTP id i8mr10254163edx.250.1626071409725; Sun, 11 Jul 2021 23:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071409; cv=none; d=google.com; s=arc-20160816; b=a3Yk8MJkYuoFwDtRvMgSE5vuciFawMj9JnW3vq+OqvezhP+7mXRPIRkpcSxKublChx zvXfQTD+QC4ft4i10gJ0bruQ0NSpk4U0yyNkKZRjr5vl7Z+lKuKknayCcAYp5L92/z0K ddtMzsOpGGexMv2QRzKSzDXC2GaPTjq3UCqbMhLXpQFOWZ+JHxWDFEakihpshxp1nbaa kac0e/FhGIgnq+HnVExZYpji/uJWb/V9vrDXoRzlan9jWFhEYPusq/wFbbzTIPITDHEz TTftpyLsfJNSEk6ol31hkDBsj1vLdkv3/wB1lPSxgLByuXJ6qZOdIsCNle6iJr87kV81 uCrw== 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=+OcMZONJbh4a522ZNxnDd3MLeJMlXGWypW2y5jan/sU=; b=ydgWRy5nBJxxkMSvxQBiwPAUVwV+cZLsx//xYvlCKZrivhA9qIInlwHla9ThuOvkUQ INYVGm3tbVXpKhE5cZnux8MGhGl2sw4UQaTcy9nF7TKbWUMF4Z6cJL/Roy7zX6cukG0J rhoEFak68ItNY4zvI1RJDcOrjW8a/AGT+MZdgMGKUJYxPlbRGi+R/LSunr6GpX7rG+vV c0lxNQDEhOROau1VBP81KPJz2AOAvQXItoJsuvG/bYsRVOosYI2DgLqE5rkkt8wSvXHx DXVp6LRDRv5TVXLQf39hsBFCV7h9AalTfBLyth1n63nC1/AhIL7BetPzpvnFgx6rGpG4 rhhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QJ63Yg6X; 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.09; Sun, 11 Jul 2021 23:30:09 -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=QJ63Yg6X; 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 S235747AbhGLGcq (ORCPT + 12 others); Mon, 12 Jul 2021 02:32:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235959AbhGLG3j (ORCPT ); Mon, 12 Jul 2021 02:29:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B85C061205; Mon, 12 Jul 2021 06:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071184; bh=HGI77c8ZRygsdCDaozfGgLK8RqEkdKa9tfBt4k4ThY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QJ63Yg6XtAevV+LpgFHQcMaH70A5wa7aGmsmTWDuKKhpr97aUhzpeT7ZTukywKfeb 5/QvNtHaXXCTKFNM3MyjChVey0E+COy9OTCE2CVgYNMghDc+DMV/Iki4lMFGk2KYVL Mo4NnssiXOeUniRMIlWUvnzAjfT+U8QeNDTK/VKE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Andreas Klinger , =?utf-8?q?Nuno_S=C3=A1?= , Sasha Levin Subject: [PATCH 5.4 311/348] iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:35 +0200 Message-Id: <20210712060745.094281828@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 6a6be221b8bd561b053f0701ec752a5ed9007f69 ] To make code more readable, use a structure to express the channel layout and ensure the timestamp is 8 byte aligned. Add a comment on why the buffer is the size it is as not immediately obvious. Found during an audit of all calls of this function. Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver") Signed-off-by: Jonathan Cameron Cc: Andreas Klinger Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-4-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/adc/mxs-lradc-adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c index 9d2f74c2489a..01f85bbe6a2e 100644 --- a/drivers/iio/adc/mxs-lradc-adc.c +++ b/drivers/iio/adc/mxs-lradc-adc.c @@ -115,7 +115,8 @@ struct mxs_lradc_adc { struct device *dev; void __iomem *base; - u32 buffer[10]; + /* Maximum of 8 channels + 8 byte ts */ + u32 buffer[10] __aligned(8); struct iio_trigger *trig; struct completion completion; spinlock_t lock;