From patchwork Mon Jul 12 06:11:38 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: 472977 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2683754jao; Mon, 12 Jul 2021 00:24:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGHhyzs9Lxylg0fBY0r6HNkj747kLAIy2YR3NvWRn4uscLzaKnM28kxNqhzqAMN/OCjDAf X-Received: by 2002:a17:907:397:: with SMTP id ss23mr6077255ejb.470.1626074674718; Mon, 12 Jul 2021 00:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074674; cv=none; d=google.com; s=arc-20160816; b=JrTZCrMb3v8ZiwfK5vrlHVfCGAZ1hyBTOynkJpXGTqf0HOjsWVIFj0FWYtvHhTVRXZ ZmzQXaxV1AbY9Q5ry9PpPKLgZbmxUej+A4oYDDu5RrR4qOz708hL1oMevmpavbWdfH2U SogJb9sFhIPRWNd3rE3fbZB5kDRDHfHIewPf1E5ixCHYSGd5hIsLIZtCk7O8kTsLDByy kRIvJVI1WKwBMNbR0BRmrrZaEKLL8zwC8BAPAh/XJx1pavvYJAvUd2zAvk6jreYRWmBE cnYvga36NKZNaMBUl8LrkYefQy4BWp46nZ9Rf4jHUGQIadD+o0saI2Oglus93cS5g4kh N/eQ== 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=wASZyHHprMOJQVYZaMrTFQISjGjAZbDwkKlvdvipHMc=; b=DwwBca7xemyG6pyn3X1Kq9V9j0FSkj47FMFrNpK7I5VTKWZIIcYvfNvp/gW4S/KwfF clemnjPDh8pf7P9sAt6MJ0vQnDE2RylEbQzwwkoleTIWZ5OO3LtjdTUBOi9rbwB8NkTE oXb1cSqZ1at4ZoPU3XlzuhzTtIKl/ZcMYgyALgSce6rwG0NVpJBAAo5oKq8RIEazYUny sdR1qSzZEegAGySMj8NfLH//RlrFvnSl6T0KfPdUQQib5o9pElAtdTcRTU6YZUmrToBq FF4GV1Ae+cJvC7b0dEplYBKyoxsbR2lXAtn4WT8LC9acXpHjnOAfGzlw8PSiOgWCcDX1 B5XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vsLz/S+F"; 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.34; Mon, 12 Jul 2021 00:24:34 -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="vsLz/S+F"; 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 S245511AbhGLH1J (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:33068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345341AbhGLHZU (ORCPT ); Mon, 12 Jul 2021 03:25:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DFC4A613CC; Mon, 12 Jul 2021 07:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074547; bh=sENWkQ5uR0IMnAxF0xKSzpMQnClAuWfwxn0h+ba6SMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vsLz/S+FmVuUc2yEEr7jEK/6f0SLK/cQUMWqezp+4Szas/K3w9T5djoOoynK0irug o7HFA3Uhyhu5kyfvYri7sKCWTlTt7jslftyfZpQiORKnwXnJs8M6sw+ndrqZDEQq9X z9SW/O2A1wuuwhmAGz/tuPEPj1zcAkzWH1jO6pgg= 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.12 615/700] iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:38 +0200 Message-Id: <20210712061041.314283145@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 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 30e29f44ebd2..c480cb489c1a 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;