From patchwork Sun Apr 13 10:34:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 14049269 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82AFE2AD3E for ; Sun, 13 Apr 2025 10:35:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744540505; cv=none; b=DMPqHgNt+tMDWvViE9cWEmbLDMAYP4ftr7ou32Nmz1IkxfZzKmrMMfapQCARdaB2boLyz72OUoC/6ykMczzVJ4lIb/yxrVQCZ8wNMo5kaZlB2dr0T4f+nlP+mffKV0lmbgM+GKZi3DDeawmsQztiwhrk6W939bbiXxRqXxpvhlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744540505; c=relaxed/simple; bh=yzWI3D1EHxTcehBtBHTfo4+WqmM2zvl/N/j64Ca+kqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mCLqW5SyHLiN3jTHHC/lbmUsAUisUTXGyOEsfkvzX5OYE5x1Y+SWYKPIkYiMWj7Mkzz/W91wwPasoCmjsW8bA4tH82TDZnw+yE6V77v7KuGaNMo0lIjpN5aBuzhwKsCbTMuWacuWxiB3u6TVDlXEXyKqSGRvOr7VbOcHwFwg9rQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o0ttk5ci; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o0ttk5ci" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE2A3C4CEDD; Sun, 13 Apr 2025 10:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744540505; bh=yzWI3D1EHxTcehBtBHTfo4+WqmM2zvl/N/j64Ca+kqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o0ttk5ciWyYJrFOzzS3wS67rmJ6f0KmDEHTIjjiDedigSgHLKQIukh453icQLvlY+ 0iWxsN0HTDTz84QdKn9TDhRRa1NUZmY9bK+RzqyX2SxjABEHSzq7F1/ofrDsyUbuEQ iJb9/HmCx5yfG+0ibHH+Z8I7nj/UMTkSRBlaTF1LEkAkPSyHjJwbT5egosOaG7PXkc alDyshjyl9zJOwTBXqdYOtNxDjNBZ5vRbAzbzaGGjcOgTKCSQ+k9G6eFhNe4PClDZR l/qjem1fBM8OXvmAVPgRr08iAcvDMzlvOsRtAGddCsbu/fxnaxHvM+pa2YNfT0EVe5 QKuouRgMlAWBg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: Jonathan Cameron Subject: [PATCH v3 04/20] iio: accel: adxl355: Make timestamp 64-bit aligned using aligned_s64 Date: Sun, 13 Apr 2025 11:34:27 +0100 Message-ID: <20250413103443.2420727-5-jic23@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250413103443.2420727-1-jic23@kernel.org> References: <20250413103443.2420727-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron The IIO ABI requires 64-bit aligned timestamps. In this case insufficient padding would have been added on architectures where an s64 is only 32-bit aligned. Use aligned_s64 to enforce the correct alignment. Fixes: 327a0eaf19d5 ("iio: accel: adxl355: Add triggered buffer support") Reported-by: David Lechner Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron --- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c index e8cd21fa77a6..cbac622ef821 100644 --- a/drivers/iio/accel/adxl355_core.c +++ b/drivers/iio/accel/adxl355_core.c @@ -231,7 +231,7 @@ struct adxl355_data { u8 transf_buf[3]; struct { u8 buf[14]; - s64 ts; + aligned_s64 ts; } buffer; } __aligned(IIO_DMA_MINALIGN); };