From patchwork Mon Jul 19 14:50:10 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: 479949 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4243264jao; Mon, 19 Jul 2021 08:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuwpYDz2ak2n2m0a9dkkl/OTrNuKAFPACwkWJh6h+09kASJDSkflE1XYWBeeA+KTLH1KT7 X-Received: by 2002:a05:6638:c4a:: with SMTP id g10mr22313113jal.21.1626709294927; Mon, 19 Jul 2021 08:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626709294; cv=none; d=google.com; s=arc-20160816; b=UhvGQFfELcJUKm/+9nnpxP00l81h3+amf0aTwK63yI4n8HFHAKupVSMlqq7E2XAbGp p8SRJCD79vV8nVwvqDpVGdC54z7abzHvfpvOAyMDP7mEXu2fUfkF7WiXiJX6lX0yq600 EeH3ZhpVyNGkVKFMua4vJYZQ5NywkZ/PyanCf7/waWO+fPI86ijq0FVM8orIuL6yt3mN lAplRAzcAOCJbrONh7Dj5iwMsCvrGwmM3FfbeBZ6dER+mPHslqRVjbN9pZqrvlEIcGqu oqq+Em0Vi3xelM7mffIDlBWZ9clLDbW4uEam3VO49nyB3Ga2U04Uxm9UgEOlKQ0Ej5zV F2hQ== 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=WQgNsrMQ0vRYU1U6AvIHVOXosc1C8wK3rWFLreWn4hU=; b=Eo7XJGH+IaYGl7feAzAgcKnLTXCLkokLREQsCj36OCMDgOAZew8sjhDVHGyWgThg/r pAwXHsd2d5zdGTQZkPRjtcXo0oxQbbjPqbKlU4HR98NRnj5qLCSWI8zibli3yUet7uxc vnOQbtJYDRomoBjiB79d3YzoU0hLKcITJ0K5kj0PEoyV7IPgHlUAxJH6SLF9Lqcoj1Hm wvOLWPPbYNl5dyGOBrRhLeFZKgB7vyay8EvF35cqp572XRi2ENViONmMcs1JgM/lhVWi cFYGu6yZGyRshGDbv46C7bjpgmqWpvIL++vfJf4mu18Y5S7k4b4cDwU42oo/pkebtU4r +xZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ol9GdANG; 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 ay16si21406520jab.96.2021.07.19.08.41.34; Mon, 19 Jul 2021 08:41:34 -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=ol9GdANG; 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 S1345343AbhGSPAf (ORCPT + 12 others); Mon, 19 Jul 2021 11:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:52440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245546AbhGSO62 (ORCPT ); Mon, 19 Jul 2021 10:58:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3F8760241; Mon, 19 Jul 2021 15:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708960; bh=vPDvrGaVntPhbmj5t9Ee+l142Dush16utM7QrCL4gtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ol9GdANGyYpVQGmBXtACzhvQZz2BkyLaWGNm+slIpORmLHydhJZnKdjiPPG551Kt/ s/iYqSTONjb8p+zD+5rd278YXjRaYlV9nQnWe5Uqc1n08klFDhvb+zIC3PgPhPNpC6 R+T5sqG144jhl3iXmM3gVAJt717VbwD1PjXihtFc= 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 4.19 199/421] iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp() Date: Mon, 19 Jul 2021 16:50:10 +0200 Message-Id: <20210719144953.282550632@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144946.310399455@linuxfoundation.org> References: <20210719144946.310399455@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 6c5d81a89aec..0dc487dd1674 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -94,9 +94,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