diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-05-26 23:02:21 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-09-03 20:40:47 +0200 |
commit | 59713492b7866e031e0c66e25f4f034c96f1be5a (patch) | |
tree | 135e5bceec4d6546ade3f35f7be0a63be0501e7d /drivers/iio/dac/ad5686.c | |
parent | iio/dac: convert ltc2632.txt to lltc,ltc2632.yaml (diff) | |
download | linux-59713492b7866e031e0c66e25f4f034c96f1be5a.tar.xz linux-59713492b7866e031e0c66e25f4f034c96f1be5a.zip |
iio: dac: ad5686: Constify static struct iio_chan_spec
These are never modified and can be made const to allow the compiler to
put it in read-only memory.
Before:
text data bss dec hex filename
6642 12608 64 19314 4b72 drivers/iio/dac/ad5686.o
After:
text data bss dec hex filename
16946 2304 64 19314 4b72 drivers/iio/dac/ad5686.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/dac/ad5686.c')
-rw-r--r-- | drivers/iio/dac/ad5686.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index 56cf9344d187..148d9541f517 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -206,12 +206,12 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = { } #define DECLARE_AD5693_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ } #define DECLARE_AD5686_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 1, bits, _shift), \ AD5868_CHANNEL(1, 2, bits, _shift), \ AD5868_CHANNEL(2, 4, bits, _shift), \ @@ -219,7 +219,7 @@ static struct iio_chan_spec name[] = { \ } #define DECLARE_AD5676_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \ @@ -231,7 +231,7 @@ static struct iio_chan_spec name[] = { \ } #define DECLARE_AD5679_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \ |