From patchwork Mon Jul 12 06:11:34 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: 472863 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2648094jao; Sun, 11 Jul 2021 23:30:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw957tjNQYGpU2PdgAkiI+ecKsCZTpoXmwC2rksDF6G5YTeKySjyslN95Bgs7iovUiCymT X-Received: by 2002:a50:d0cf:: with SMTP id g15mr40879882edf.219.1626071413492; Sun, 11 Jul 2021 23:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071413; cv=none; d=google.com; s=arc-20160816; b=Q1XgR1cxo50T627JrInCF/ZgKkVtcGX/g3sNxYy/VdhUmtFG6JxNvNI+GoZL4CJGcC /NGlx1baRQUHJ543xdfsnCZov3P19OZNcGsbTqaWGXRAL2Y5D3ZiFMm/lhnXkp3VkNX2 vrsVF/GXtRDzwOyqzgPP6YyDCRjGZ+Dntt90WCmqn9iWhv0JrGkZbmt5OB5x9dH38NMu NTwuzO14vZhD0ktz0XtLskradFmIH+rCk9yC+WK6bfeyCGQdgEyUhASU70/wcPbutE8h WEXNwWheQrq1c6iMLz/BM9VUe/bl+XH1M89pGrQuzO0bc7cOej0U6lhepdJYwO3a+Rwj m6vQ== 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=dHAt3Te3gc5PeKvvcWtQwauQbPlhaMdAtmWEeMC9GOA=; b=RrOzZ2IgQYDwQxqHEsL5/AJ2p+xOVCkbaQhvXc/Ql4OL2yTFqK7GMkvSsAkQUfQG2L ShQ5/RqclmXqB7wD1mMijiBZ9bBOhs67iblFt9PNpyTgvGQAzonibtkIYiZVviqkwTeT zHXTW5Sinq1ngY6GqKvoEa49fPunBL2vejp+qfiXpOq1QRKEfODsxfRuHwhCadmc2Ewb 9hxEYix6WOZPx+sAp+H9sCFgPPIdy5KYtfyTJ21asPURx7+J0hKOuzxEdthgTlhbHI39 60d1vPpJlBVMkq7hAHtRdGddexCplDy1s8zn05LJPGwt1pnHocOii7CPEad2UQWkAyVQ olFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z6uR/Yr4"; 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 bz6si16420285ejc.610.2021.07.11.23.30.13; Sun, 11 Jul 2021 23:30:13 -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="z6uR/Yr4"; 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 S235841AbhGLGcv (ORCPT + 12 others); Mon, 12 Jul 2021 02:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:48074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235940AbhGLG3j (ORCPT ); Mon, 12 Jul 2021 02:29:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6850361166; Mon, 12 Jul 2021 06:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071181; bh=UOiV8x1p7nspUJGgzh7j+xn/gUGBhu5AZ4wxndVO/ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z6uR/Yr41hvtRP6nG6V2IIXfrvKFi/s+PUIc5xrOWklmjOwuQlZBis+SAirHCx2CI ++KuEnZkPOVtwTAPDrdp7lQn9sARj56Ehh89/PDxwAD4YLM8R8iGBxYmDypc+mf3r4 lHp9i7cjfrWBWgZuy8Vo17/ra36YFPMY0A9uAljo= 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.4 310/348] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:34 +0200 Message-Id: <20210712060744.970589325@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 62e6c8badd22..a3265166fd83 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -85,9 +85,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