Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2716795pxv; Sun, 11 Jul 2021 23:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpmdnxErXG3vd3ZfQ+3S441pUCXQQhtibnwLnO1arxOt01rtHO5fey85W6kBcTSpV+naJy X-Received: by 2002:a50:fb04:: with SMTP id d4mr42035135edq.143.1626071982577; Sun, 11 Jul 2021 23:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071982; cv=none; d=google.com; s=arc-20160816; b=EqnDdYhhXaAic6fOSK3kizNNRP1kPAWiAy8sNGszqW6AhBBdwq9AMNayLvD83VF+Cg Y+j0kIMfLkOCysF2Co3O7wLAH6KQv+0iEdXyIJNPxGy0DuoFRniT8JOCENmvJfcQ8QmH ERTvarByJGGPofpFAKUS3+Z+rDe78OEw1QPAj8zryxUertMO9lAzo6DKBucxanscBe9p YBnB9B/ZTSndUqKw4qSC5mZO9S06lZKUAx8yiGjiY7GV+G78TleOiTDEuGFhaCgkB2rU O5vis6wQ1iptAL3l6Xjmd6zlLYJXRVCn2yYNb+NmYbTTSl2WN8VY33xbFg3HsbQfIPye CETg== 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=q5/hYknU3WrzU/jUPMU1dSLoQ8c/9Z+Mqzo/VpGNJDCbg3A0vRb4QQsERNeAOhG5Ks P+fnEgJnmbnSNwcCWVWoQ0/AybcV6P8B/Qc6yOaX7sWn0Sn88CDA3CZKL1ig4tI3VsKp liBYL4NZUermrCk2lTwp68Olei9DDDrlr6nzVkHn8arrQ0Xz30fJsp85pS+ABzyoIgHb msBVcN2jYbEtzwCZM7uU/TOARqVmmoAA4il5e1VgnyTh5Lj3mneIczqUVx56XpJ282w2 MgkpZiKwWZnTVMOn++kK4AjpqANpdTkjZRwaVnYbsR1bqbVRwfnPlCIN+rXvWUam4a6D fztw== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 gh10si5911097ejc.319.2021.07.11.23.39.20; Sun, 11 Jul 2021 23:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S236037AbhGLGjE (ORCPT + 99 others); Mon, 12 Jul 2021 02:39:04 -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=20S=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 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 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 -- 2.30.2