From patchwork Mon Jul 12 06:11:37 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: 472993 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2684804jao; Mon, 12 Jul 2021 00:26:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqX24nDFj2fXKcEIx6+wckGIF23s1COSAhw9V7PmSXuzX6Q/jnycp3TqE3ovYzDfjCdpqD X-Received: by 2002:a17:906:4b46:: with SMTP id j6mr1854472ejv.247.1626074673109; Mon, 12 Jul 2021 00:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074673; cv=none; d=google.com; s=arc-20160816; b=mEFwCw+pLsNrUg7fbiRvETbx6/Cf4BxeI4dFkpYuv4w3R1EjbWzKgerxtkizqKYxBn jylP8pGF+ebunt6btAB3Wh7Kb9dewWtd0cwN0KRa0gK2KxT+wzecyBo9UW1F+pkghdHS kkuw2Y7Ri8LmBCe5Y0W1WdHSlE2sHqSQBKwRF6Rgo5hwijXjztjGY/QSsC01+nMh20Pa C/MR95gUW57K1i8g0MQQBrYiV5NnzDXYvfdPHCEdJhj8D46CjOQSixhcrAK79sYCxokW rdjOwyg2hALOOVBkGlgzCH5UIfX7t7opH20uW28EW2cnhsyZI2n4lx/Qp/eKZyvpRvkO wpgw== 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=m4/skQg4XZyZth4VQ9pt6dk1Qs0pGnmwF8aD/etuyNMWs7VxhZ/A4mXBZn58AEYB7f 2mJDQoVo9c66UPpLfPgGnSFGilGBorjm1ia8VxMkchZ5+PJaygbVc6qstFZ2mcmyCsGI VuOrpBmgEtPptH+idOYh5j45L/jV4dAYtWjxB5Rb/XM8Z05I2kqg6O7dtcs/Htmwl2KI xFLosFR5lvTd+OtAqPz4gBlsvCdLvYdxZpNBWb5/hEwYwAiQDRPNsea/RFI0ZujDNDWG ELl0Ll8Dyh83rAvI1OHyeRuT7pgFBO6jKWCl0mUaTSeq+QnmoOXi2NqHpbPVk5ywSf/P 3fBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xVOZNlFZ; 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.32; Mon, 12 Jul 2021 00:24:33 -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=xVOZNlFZ; 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 S241617AbhGLH1I (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345324AbhGLHZS (ORCPT ); Mon, 12 Jul 2021 03:25:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C21A561369; Mon, 12 Jul 2021 07:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074544; bh=7ig6Boh5ZC+q/X3fhU+8OylFMeep0I6e83jHJe3dyw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xVOZNlFZlpYlLUp+JHreg3A7ojjw2J0NA0Ryn8O9RMLoAohrPRKisx8+9SyMzj1k7 IAXIdAwQvTKn/j6ADFw4P/ZQNT4ruFi8bg359/LjrpgldzaLdqgbLpND42o7DdQql7 zBaWkQF70++U/5ChEOfQRCvtE8ZGVejwQkUOEJP0= 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 614/700] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:37 +0200 Message-Id: <20210712061041.219438842@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 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