]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: ov5648: make read-only arrays regs and values static const
authorColin Ian King <colin.i.king@gmail.com>
Tue, 29 Jul 2025 07:00:21 +0000 (08:00 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 25 Aug 2025 13:40:38 +0000 (15:40 +0200)
Don't populate the read-only arrays regs and values on the stack at run
time, instead make them static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov5648.c

index 8a3190bf73daf32f5c8bbe0dae6bf71a373f07e7..f0b839cd65f11a39138503d89b46424d2aef7032 100644 (file)
@@ -1061,8 +1061,8 @@ static int ov5648_sw_standby(struct ov5648_sensor *sensor, int standby)
 
 static int ov5648_chip_id_check(struct ov5648_sensor *sensor)
 {
-       u16 regs[] = { OV5648_CHIP_ID_H_REG, OV5648_CHIP_ID_L_REG };
-       u8 values[] = { OV5648_CHIP_ID_H_VALUE, OV5648_CHIP_ID_L_VALUE };
+       static const u16 regs[] = { OV5648_CHIP_ID_H_REG, OV5648_CHIP_ID_L_REG };
+       static const u8 values[] = { OV5648_CHIP_ID_H_VALUE, OV5648_CHIP_ID_L_VALUE };
        unsigned int i;
        u8 value;
        int ret;