From patchwork Mon Jul 12 06:12:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 473053 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2717211jao; Mon, 12 Jul 2021 01:15:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfPOmuQwoZDCpRmTYpgjTU6Zl92wiaaKhyTCkmagKf9DxBTSB4EqG49fKOvA1/Aznyron5 X-Received: by 2002:a17:906:5a6f:: with SMTP id my47mr16727278ejc.29.1626077749041; Mon, 12 Jul 2021 01:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626077749; cv=none; d=google.com; s=arc-20160816; b=FuVubEy6iNSnl8cdnlbFfEgrQvMeNfB2dgqHMBF77+2AZQldpF7Yt3CH8vp5oq8TbH PjIAzth6+aXGdEhN8dZZsQHK5h1gulquehjwV99JtG9hdUpcQSgWQu0IbfdsUu8toY7O 0ox6S8uHfZvWLq8jAd9cI8s5Ie3e6gVFwkOsFF06UXaKjVw5CTL0wyErT4KAn7kUR5Av 7Pou9gUlrjd6i/FcM2hBKVxxXQedS8QY1xAFZrvsNhFReGgx45wy4IQN8DrN89K133Y7 kuLBL0LmmmEo/3O9qAnlawVPuJaqP0MwrVpEw/p2k4/coiclDFYsxhlbYYAhcGj+ZBR6 s7Ug== 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=Q6eVCW5kJibeCSRIcSzSgcmltRynRLQ8hHI2dIaNgTg=; b=fu5Wg5XIuIp7MmGe3IHvcI8GD5pejKB7AI+j4wos6tssdFofbNVXoZszli6WW50Hn4 Sx8JV3P83seco7xQAyIarBLA7OG9fZkDQxZctmusdypebnezZV+H/Sw9UloRKSaV/N4U rpFnDBm5W7jjph/IYRelCI+Gqwlf8D8M9LOZRlKCao1hPjNiKlOtz3SKJgE7IPmyR8pL bZCvAjPv97Ml7gwGxUkctobMSPJiwbnVo7d8bO3wZGCTw8YLQJcmLUTAshvKfvItMcN6 YC3EAULkc62eFyMDN7SOlLN+DZyRSKt7sQYSVf1ZJgwDgRrQb+dEMWKu7w8wpmPwGWpd Kdog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V4d1ACvy; 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 n21si13642925eda.13.2021.07.12.01.15.48; Mon, 12 Jul 2021 01:15:49 -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=V4d1ACvy; 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 S1355714AbhGLIKP (ORCPT + 12 others); Mon, 12 Jul 2021 04:10:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:55048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353652AbhGLICo (ORCPT ); Mon, 12 Jul 2021 04:02:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5091F61CEC; Mon, 12 Jul 2021 07:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626076591; bh=7ig6Boh5ZC+q/X3fhU+8OylFMeep0I6e83jHJe3dyw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V4d1ACvy33PWqJ1yU+2wRt+aXEUcXy9RGwPfmF0nKUODZYptwIwJWQabyz92Zu2aQ ZISOCYKGoB8UB8/WHCHfImDCV+jQ7MJFbsBf1Yk/GWK8B88H8BAeiKWoFHwGC9FSyq PWGt+LLYVOfOD+WYYfv+9IUS62uBFby/99Io9jEA= 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.13 710/800] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:12:13 +0200 Message-Id: <20210712061042.261290038@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@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 afe2a789fbf7acd1a05407fc7839cc08d23825e3 ] 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: d3bf60450d47 ("iio: hx711: add triggered buffer support") Signed-off-by: Jonathan Cameron Cc: Andreas Klinger Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-3-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/adc/hx711.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index 6a173531d355..f7ee856a6b8b 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -86,9 +86,9 @@ struct hx711_data { struct mutex lock; /* * triggered buffer - * 2x32-bit channel + 64-bit timestamp + * 2x32-bit channel + 64-bit naturally aligned timestamp */ - u32 buffer[4]; + u32 buffer[4] __aligned(8); /* * delay after a rising edge on SCK until the data is ready DOUT * this is dependent on the hx711 where the datasheet tells a