summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer/ak8974.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-04-20 11:18:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-04-20 11:57:54 -0700
commit05e8d261a34e5c637e37be55c26e42cf5c75ee5c (patch)
tree946d1ca767a6a84ef9be07834eca6e997626f5a3 /drivers/iio/magnetometer/ak8974.c
parentbe913e7c4034bd7a5cbfc3d53188344dc588d45c (diff)
gcc-15: add '__nonstring' markers to byte arrays
All of these cases are perfectly valid and good traditional C, but hit by the "you're not NUL-terminating your byte array" warning. And none of the cases want any terminating NUL character. Mark them __nonstring to shut up gcc-15 (and in the case of the ak8974 magnetometer driver, I just removed the explicit array size and let gcc expand the 3-byte and 6-byte arrays by one extra byte, because it was the simpler change). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/iio/magnetometer/ak8974.c')
-rw-r--r--drivers/iio/magnetometer/ak8974.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index 08975c60e325..7bc341c69697 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -535,8 +535,8 @@ static int ak8974_detect(struct ak8974 *ak8974)
fab_data2, sizeof(fab_data2));
for (i = 0; i < 3; ++i) {
- static const char axis[3] = "XYZ";
- static const char pgaxis[6] = "ZYZXYX";
+ static const char axis[] = "XYZ";
+ static const char pgaxis[] = "ZYZXYX";
unsigned offz = le16_to_cpu(fab_data2[i]) & 0x7F;
unsigned fine = le16_to_cpu(fab_data1[i]);
unsigned sens = le16_to_cpu(fab_data1[i + 3]);