[PATCH][next] iio: light: vcnl4000: make read-only const array regulator_names static

Colin Ian King posted 1 patch 1 week, 4 days ago
drivers/iio/light/vcnl4000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH][next] iio: light: vcnl4000: make read-only const array regulator_names static
Posted by Colin Ian King 1 week, 4 days ago
Don't populate the read-only const array regulator_names on the stack
at run time, instead make it static const char * const

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/iio/light/vcnl4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 128ae3f94074..b8ac156ad5c9 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -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;
-- 
2.53.0
Re: [PATCH][next] iio: light: vcnl4000: make read-only const array regulator_names static
Posted by Andy Shevchenko 1 week, 4 days ago
On Tue, Jul 14, 2026 at 05:57:39PM +0100, Colin Ian King wrote:
> 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
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH][next] iio: light: vcnl4000: make read-only const array regulator_names static
Posted by Jonathan Cameron 5 days, 16 hours ago
On Tue, 14 Jul 2026 20:05:32 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Tue, Jul 14, 2026 at 05:57:39PM +0100, Colin Ian King wrote:
> > 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
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 


Applied.

Thanks

J