From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8C9EC64E6E for ; Mon, 19 Jul 2021 16:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE6256113B for ; Mon, 19 Jul 2021 16:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350064AbhGSPgh (ORCPT ); Mon, 19 Jul 2021 11:36:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245546AbhGSO62 (ORCPT ); Mon, 19 Jul 2021 10:58:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3F8760241; Mon, 19 Jul 2021 15:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708960; bh=vPDvrGaVntPhbmj5t9Ee+l142Dush16utM7QrCL4gtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ol9GdANGyYpVQGmBXtACzhvQZz2BkyLaWGNm+slIpORmLHydhJZnKdjiPPG551Kt/ s/iYqSTONjb8p+zD+5rd278YXjRaYlV9nQnWe5Uqc1n08klFDhvb+zIC3PgPhPNpC6 R+T5sqG144jhl3iXmM3gVAJt717VbwD1PjXihtFc= 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=20S=C3=A1?= , Sasha Levin Subject: [PATCH 4.19 199/421] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 19 Jul 2021 16:50:10 +0200 Message-Id: <20210719144953.282550632@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144946.310399455@linuxfoundation.org> References: <20210719144946.310399455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index 6c5d81a89aec..0dc487dd1674 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -94,9 +94,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 -- 2.30.2