]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: chemical: scd30: make command lookup table const
authorGiorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Fri, 8 May 2026 13:39:17 +0000 (17:39 +0400)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:37 +0000 (10:59 +0100)
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>
Reviewed-by: Stepan Ionichev <sozdayvek@gmail.com>
Acked-by: Maxwell Doose <m32285159@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/chemical/scd30_i2c.c

index 436df9c61a719f600bfc4a57856c3b668d82f477..bf465cc71be7d44c17eb25dbed443b133436f95e 100644 (file)
@@ -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,