Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: chemical: scd30: make command lookup table const
@ 2026-05-08 13:39 Giorgi Tchankvetadze
  2026-05-08 15:07 ` Maxwell Doose
  2026-05-09 11:16 ` [PATCH 3/3] " Stepan Ionichev
  0 siblings, 2 replies; 10+ messages in thread
From: Giorgi Tchankvetadze @ 2026-05-08 13:39 UTC (permalink / raw)
  To: antoniu.miclaus, lars, Michael.Hennerich, jic23
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel,
	Giorgi Tchankvetadze

scd30_i2c_cmd_lookup_tbl contains fixed opcodes and is
only read by scd30_i2c_command(). Make it const to document that it's immutable
and allow it to be placed in read-only memory.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
---
 drivers/iio/chemical/scd30_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/scd30_i2c.c b/drivers/iio/chemical/scd30_i2c.c
index 436df9c61a71..bf465cc71be7 100644
--- a/drivers/iio/chemical/scd30_i2c.c
+++ b/drivers/iio/chemical/scd30_i2c.c
@@ -20,7 +20,7 @@
 #define SCD30_I2C_MAX_BUF_SIZE 18
 #define SCD30_I2C_CRC8_POLYNOMIAL 0x31
 
-static u16 scd30_i2c_cmd_lookup_tbl[] = {
+static const u16 scd30_i2c_cmd_lookup_tbl[] = {
 	[CMD_START_MEAS] = 0x0010,
 	[CMD_STOP_MEAS] = 0x0104,
 	[CMD_MEAS_INTERVAL] = 0x4600,
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-05-10  9:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 13:39 [PATCH] iio: chemical: scd30: make command lookup table const Giorgi Tchankvetadze
2026-05-08 15:07 ` Maxwell Doose
2026-05-09 11:16 ` [PATCH 3/3] " Stepan Ionichev
2026-05-10  0:31   ` Stepan Ionichev
2026-05-10  0:42     ` Stepan Ionichev
2026-05-10  1:05       ` Stepan Ionichev
2026-05-10  8:04       ` Maxwell Doose
2026-05-10  9:08         ` Andy Shevchenko
2026-05-10  7:52     ` Maxwell Doose
2026-05-10  7:21   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox