From patchwork Mon Jul 12 06:11:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 472921 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2661940jao; Sun, 11 Jul 2021 23:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVGpK7/S+jGcS1OG/RFIeWlfBv9eYkYvT0jsOUJ0aFksJSIuAEq+apZVIREbami+fHfS2a X-Received: by 2002:a17:907:1c95:: with SMTP id nb21mr43505674ejc.163.1626072753524; Sun, 11 Jul 2021 23:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626072753; cv=none; d=google.com; s=arc-20160816; b=LmuylfND1Xxgb1IYnMPdUshN5sx9Jb8UjNBHC+jNP1SaCUJQhDUW1Fc1OkM8acJgso 5cZxxcLAIw2DVFLfVlDfdzm5vofxpYGwz4m7rl0MifQv5FYsDDggNrtRZmXoYYx9UqoD qkM94VGeB8YCvyJGACyCXSfSFZ8SkViglLgTYaYImojtTCgyd8BujkxwPiXkrf8WT8wN ntRXbC8tYi82m3SeOmuKmqEfu3Yf3A/ZBVxrRXcEk20Jwk272KfcBaBju10xxHVt2mk7 EhwXQF1UK3jDq0vBGkvYtrEbDGmqK/dvCsMCRelWb55qcsrOSrjOZ96D6kmyu0+Zhn2D viiA== 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=mLj5nkQtJUngnYSMb0KXQp8UEy80oxze6Grv4m74UcxikUnogvkcppokJKIPe7EGdV CdUhbLpO4WDAwLMKxOgJfDL70rbclrDCQoocNqkPivw+M/9U+NHdbmu3Ky95iBLtXW6c CBGqYO5qomOFCZXxNUvC+YREm2IqZ5sIOKdctGpQifo0cKHOEQcjqaRFJ6BectvzYpf6 VdqWCFI+F1SEGtqEAVzcJZCKb+GchCkjD2t9tq9MczTMs5zjkH76LTWCnUdWNxZisuaH NLM/y0v12ksO6cP4pKXFANdVwO+DmY9eL/7H2WCeiu2O1FFIj7zX3xKhehciCpmEu6+N sZkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1hLjmV3b; 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 r25si3440466edp.437.2021.07.11.23.52.33; Sun, 11 Jul 2021 23:52: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=1hLjmV3b; 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 S240536AbhGLGxl (ORCPT + 12 others); Mon, 12 Jul 2021 02:53:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240340AbhGLGvm (ORCPT ); Mon, 12 Jul 2021 02:51:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E0E261008; Mon, 12 Jul 2021 06:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626072500; bh=7ig6Boh5ZC+q/X3fhU+8OylFMeep0I6e83jHJe3dyw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1hLjmV3bARGJStK65QRkOJGI6z/StiTGu9QIx0xziynzHuXzXWDtwq0dzI08v0899 ZgEZ/HKIBbNbvw2WdvWmyU065zV5B6h8VkM5igyW6r0NhCjMGZ+Lwm7AcfXtbzJ/6N Lyggl4N8QuQzB4Ni4MhCUh6IlJdUr70m/9j6S3v4= 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.10 516/593] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:16 +0200 Message-Id: <20210712060948.922083078@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@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