From patchwork Mon Jul 19 14:50: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: 479915 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4228972jao; Mon, 19 Jul 2021 08:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy54M/cPUlK1vKutGWlI74lPRA8q9exPt1/pL8e5OyJMLH0f5uPWwX1bHhrE2M99gyPnZH X-Received: by 2002:a02:908a:: with SMTP id x10mr21870111jaf.30.1626708201627; Mon, 19 Jul 2021 08:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626708201; cv=none; d=google.com; s=arc-20160816; b=AjRKnR+XzGwMkTID34Gx2Wtc5G8T72y50upQmZWXtjmTSw8tHYicHtl4miDCtsWuEk VKYr7KEVktmXHEYT4SSn1WrIngraNZvVpojOSSpOIK2qvYep3zGyqRPNdClTnNIN5X08 U6gc6iZQUjPuEjHsOfL0VdwQAhYyQnKJ4L3Atb8KKB7Nop0So5m+Pb1aZUeeJSnflbhu q9zVZ68Y5qXCq3hcVdawHqbuE5p3+vyA0grSvIiGbFRcjfGfadZqQIW+JfkOzKhZ6trb d0Rv13bbRm2bAsF6IvNaIW9GFpfVvlpULM8/b5t+r5lgTjTRQQzAAsvF0nfuaLHsQSBv JbAA== 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=cFfgAE36rT8eKpqeq2007oBcEUIs5x5JIJn7lQOXtAc=; b=MT/wno9lxnT1Xg5fZLkveJG8r7wrlYkpZ1MUqTgdJM+oC6/J2OY6LTZNv0KZCmjPsB Siu7vTPipFTyhNyoX3WHS34tslzceO33ATJxl1tg7cHoa8ppXoaAHSAYJMQn/acVCW7z a4wtJO3U2isWFJq3TX+fyUgWbN9QUdnMO6nGX54adnNS9o4CNa8n/8kxf4ikQsZ9Zh/Y IhogFeqfga+Nf9vJPXoY7MRW/G+f3mew1ik86n8CL67LGTYKthVpCYyCt06BibnUXIiG NYBMD5WZETicx4/lObeHBv7MzLRg0iultZRBY9IFkrKwLet4Ix4Rihd1KAvmyOpj3tn8 zE7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ipzzQFLr; 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 g15si9692004iln.71.2021.07.19.08.23.21; Mon, 19 Jul 2021 08:23:21 -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=ipzzQFLr; 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 S243750AbhGSOmi (ORCPT + 12 others); Mon, 19 Jul 2021 10:42:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:60454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243396AbhGSOkT (ORCPT ); Mon, 19 Jul 2021 10:40:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E6BE61003; Mon, 19 Jul 2021 15:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708051; bh=2++qUXzGHmc5icuBqQoFxmJH5h/5aS1s2oKrjMNj+gk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ipzzQFLr0/aGlgsVYXN/vqGSmzWX+M+INlEupg0o0ZnMW6WeAPqNV44BFCTo8B0VO pCA3HVKXS5vA0HKIkZQ2aSzDgKcgKhWDQG9ZViKdnpF3en77QH+3Bfe94ZVQtdrIg1 E+TM6W0mSi4RJCn0VCAlbHAu3bs7SQdPFSSgHofw= 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 4.14 144/315] iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 19 Jul 2021 16:50:33 +0200 Message-Id: <20210719144947.621629345@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@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 d32b34638c2f..8c193d006967 100644 --- a/drivers/iio/adc/mxs-lradc-adc.c +++ b/drivers/iio/adc/mxs-lradc-adc.c @@ -124,7 +124,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;