From patchwork Sat May 1 17:13:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12234913 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=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 24187C433B4 for ; Sat, 1 May 2021 17:15:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02B12615FF for ; Sat, 1 May 2021 17:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbhEARQQ (ORCPT ); Sat, 1 May 2021 13:16:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:53952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbhEARQQ (ORCPT ); Sat, 1 May 2021 13:16:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D9F26157E; Sat, 1 May 2021 17:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619889326; bh=G/aARWL/UXZKE07O8rgezZHf4+23LQMuKHdE+YetCGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrbiNsSw3uxuGQbRzvy4+gf1uET8tmIj/bPiJAY3LK928H3V+xDLO+5oSCBxD6vxl vPrGk9g0tq5Q/ve3bZVdOLAUOL3J0qTWE+552ZL2f+dTtUSeu/QJKbWMRQmIGUurMM 3cIvwdHesWOonCU32djFObtLRlRqGMJlpCBvMA3r3GhB3cStb0ef9WiSOKDP/pEk/+ QaVxqF3HcfdpVVETJ26co1bhDb6mIc0wOYxYYZPh4vp96Yt01tAt8JPkdTMz8zcVLX k/b33BCFnKFP+cX4e8K1hXRtDAfDCeIOGNR0YlVKkITDHsiWEfbWtLGlP3EOTj6wR6 /KtEbCaDPinRA== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Jonathan Cameron , Andreas Klinger Subject: [PATCH 02/11] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Sat, 1 May 2021 18:13:43 +0100 Message-Id: <20210501171352.512953-3-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210501171352.512953-1-jic23@kernel.org> References: <20210501171352.512953-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron 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 --- 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 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