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>
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;