summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>2026-03-23 10:46:41 +0400
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-03-25 20:27:13 +0000
commit6b4cd7b76ee7ed4fb6c74d3876a73979b3669536 (patch)
treef7fdc7c2586bf1e38254ad71b0daab81e2c35ded
parent7198b881fb00526f6e1125bba0a24e7dc8d95a90 (diff)
iio: adc: max11410: make vref register name arrays static const
The vrefp_regs and vrefn_regs arrays are constant lookup tables and are not modified. Make them static const so they are not reinitialized on each probe call and are placed in read-only memory. Mark the pointer array as const as well to prevent unintended modification. Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/max11410.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/max11410.c b/drivers/iio/adc/max11410.c
index 511b2f14dfaf..69351f4f10bb 100644
--- a/drivers/iio/adc/max11410.c
+++ b/drivers/iio/adc/max11410.c
@@ -912,8 +912,8 @@ static int max11410_self_calibrate(struct max11410_state *st)
static int max11410_probe(struct spi_device *spi)
{
- const char *vrefp_regs[] = { "vref0p", "vref1p", "vref2p" };
- const char *vrefn_regs[] = { "vref0n", "vref1n", "vref2n" };
+ static const char * const vrefp_regs[] = { "vref0p", "vref1p", "vref2p" };
+ static const char * const vrefn_regs[] = { "vref0n", "vref1n", "vref2n" };
struct device *dev = &spi->dev;
struct max11410_state *st;
struct iio_dev *indio_dev;