Skip to contentSkip to conversation

iio: light: vcnl4000: make read-only const array regulator_names static

PATCH Applied Colin Ian King 3 participants 3 messages Jul 14 – Jul 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: light: vcnl4000: make read-only const array regulator_names static

Don't populate the read-only const array regulator_names on the stack at run time, instead make it static const char * const

---
 drivers/iio/light/vcnl4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/vcnl4000.c +1 -1
index 128ae3f94074..b8ac156ad5c9 100644
@@ -1922,7 +1922,7 @@ static void vcnl4000_cleanup(void *data)
 
 static int vcnl4000_probe(struct i2c_client *client)
 {
-	const char * const regulator_names[] = { "vdd", "vio", "vled" };
+	static const char * const regulator_names[] = { "vdd", "vio", "vled" };
 	struct device *dev = &client->dev;
 	struct vcnl4000_data *data;
 	struct iio_dev *indio_dev;
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Colin Ian King

Don't populate the read-only const array regulator_names on the stack at run time, instead make it static const char * const

Makes sense

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 7 lines · On Tue, 14 Jul 2026 20:05:32 +0300 Andy Shevchenko…
Quoted 2 lines · Colin Ian King

Don't populate the read-only const array regulator_names on the stack at run time, instead make it static const char * const

Makes sense

Applied.

Thanks

J