From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D219AC11F66 for ; Mon, 12 Jul 2021 07:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDA4161166 for ; Mon, 12 Jul 2021 07:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343743AbhGLHUC (ORCPT ); Mon, 12 Jul 2021 03:20:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240355AbhGLGxz (ORCPT ); Mon, 12 Jul 2021 02:53:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A0C861154; Mon, 12 Jul 2021 06:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626072662; bh=jRKv6eYizbrlcsTnp5IQn5e22UGVdEp1u8WKoEe1Yw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qILTHfp1ODNcB1abi3+LQg3gxOMYQSzh7uThpGlmJK/DJOneyump4s6cgzS5To/DX 3u9ADF1pTpeuaECRdfFTvVcT0ISQyBMJeq3LwDK7+EPaYOCUh4tWm5V1b7yxOcKGVb Em5TDUvvlUxFHfxDc6dwnn2TZxA+F+BYJC8Q2ZAc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Song Qiang , =?UTF-8?q?Nuno=20S=C3=A1?= , Sasha Levin Subject: [PATCH 5.10 519/593] iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:19 +0200 Message-Id: <20210712060949.537040391@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 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 b8f939fd20690623cb24845a563e7bc1e4a21482 ] Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted. Here an explicit structure is not used, because this buffer is used in a non-trivial way for data repacking. Fixes: 121354b2eceb ("iio: magnetometer: Add driver support for PNI RM3100") Signed-off-by: Jonathan Cameron Cc: Song Qiang Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-6-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/magnetometer/rm3100-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c index 7242897a05e9..720234a91db1 100644 --- a/drivers/iio/magnetometer/rm3100-core.c +++ b/drivers/iio/magnetometer/rm3100-core.c @@ -78,7 +78,8 @@ struct rm3100_data { bool use_interrupt; int conversion_time; int scale; - u8 buffer[RM3100_SCAN_BYTES]; + /* Ensure naturally aligned timestamp */ + u8 buffer[RM3100_SCAN_BYTES] __aligned(8); struct iio_trigger *drdy_trig; /* -- 2.30.2