Skip to content

Commit 6ffa698

Browse files
dlechjic23
authored andcommitted
iio: chemical: pms7003: use aligned_s64 for timestamp
Follow the pattern of other drivers and use aligned_s64 for the timestamp. This will ensure that the timestamp is correctly aligned on all architectures. Also move the unaligned.h header while touching this since it was the only one not in alphabetical order. Fixes: 13e9456 ("iio:chemical:pms7003: Fix timestamp alignment and prevent data leak.") Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250417-iio-more-timestamp-alignment-v1-4-eafac1e22318@baylibre.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent bb49d94 commit 6ffa698

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iio/chemical/pms7003.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Copyright (c) Tomasz Duszynski <tduszyns@gmail.com>
66
*/
77

8-
#include <linux/unaligned.h>
98
#include <linux/completion.h>
109
#include <linux/device.h>
1110
#include <linux/errno.h>
@@ -19,6 +18,8 @@
1918
#include <linux/module.h>
2019
#include <linux/mutex.h>
2120
#include <linux/serdev.h>
21+
#include <linux/types.h>
22+
#include <linux/unaligned.h>
2223

2324
#define PMS7003_DRIVER_NAME "pms7003"
2425

@@ -76,7 +77,7 @@ struct pms7003_state {
7677
/* Used to construct scan to push to the IIO buffer */
7778
struct {
7879
u16 data[3]; /* PM1, PM2P5, PM10 */
79-
s64 ts;
80+
aligned_s64 ts;
8081
} scan;
8182
};
8283

0 commit comments

Comments
 (0)