* [PATCH 0/6] drivers/iio: Constify structs
@ 2020-05-26 21:02 Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Rikard Falkeborn
` (5 more replies)
0 siblings, 6 replies; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn, linux-pm,
Michael Hennerich
Constify a number of static structs to allow the compiler to put them in
read-only memory. The patches are independent.
Rikard Falkeborn (6):
iio: adc: max11100: Constify struct iio_chan_spec
iio: dac: ad5380: Constify struct iio_chan_spec_ext_info
iio: dac: ad5592r-base: Constify struct iio_chan_spec_ext_info
iio: dac: ad5686: Constify static struct iio_chan_spec
iio: light: stk3310: Constify regmap_config
iio: magnetometer: mmc35240: Constify struct reg_default
drivers/iio/adc/max11100.c | 2 +-
drivers/iio/dac/ad5380.c | 2 +-
drivers/iio/dac/ad5592r-base.c | 2 +-
drivers/iio/dac/ad5686.c | 8 ++++----
drivers/iio/dac/ad5686.h | 2 +-
drivers/iio/light/stk3310.c | 2 +-
drivers/iio/magnetometer/mmc35240.c | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-31 13:07 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info Rikard Falkeborn
` (4 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn
max11100_channels is not modified and can therefore be made const to
allow the compiler to put it in read-only memory.
Before:
text data bss dec hex filename
3776 1168 0 4944 1350 drivers/iio/adc/max11100.o
After:
text data bss dec hex filename
3968 976 0 4944 1350 drivers/iio/adc/max11100.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iio/adc/max11100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c
index 3440539cfdba..b121ca78f851 100644
--- a/drivers/iio/adc/max11100.c
+++ b/drivers/iio/adc/max11100.c
@@ -37,7 +37,7 @@ struct max11100_state {
u8 buffer[3] ____cacheline_aligned;
};
-static struct iio_chan_spec max11100_channels[] = {
+static const struct iio_chan_spec max11100_channels[] = {
{ /* [0] */
.type = IIO_VOLTAGE,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-26 21:02 ` [PATCH 3/6] iio: dac: ad5592r-base: " Rikard Falkeborn
` (3 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn, Michael Hennerich
ad5380_ext_info is not modified and can be made const to allow the
compiler to put it in read-only memory.
Before:
text data bss dec hex filename
12060 3280 192 15532 3cac drivers/iio/dac/ad5380.o
After:
text data bss dec hex filename
12252 3088 192 15532 3cac drivers/iio/dac/ad5380.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iio/dac/ad5380.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
index b37e5675f716..04c74cc1a4ec 100644
--- a/drivers/iio/dac/ad5380.c
+++ b/drivers/iio/dac/ad5380.c
@@ -240,7 +240,7 @@ static const struct iio_info ad5380_info = {
.write_raw = ad5380_write_raw,
};
-static struct iio_chan_spec_ext_info ad5380_ext_info[] = {
+static const struct iio_chan_spec_ext_info ad5380_ext_info[] = {
{
.name = "powerdown",
.read = ad5380_read_dac_powerdown,
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/6] iio: dac: ad5592r-base: Constify struct iio_chan_spec_ext_info
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-26 21:02 ` [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec Rikard Falkeborn
` (2 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn, Michael Hennerich
ad5592r_ext_info is not modified and can be made const to allow the
compiler to put it in read-only memory.
Before:
text data bss dec hex filename
13293 2088 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
After:
text data bss dec hex filename
13421 1960 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iio/dac/ad5592r-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
index 410e90e5f75f..7402f67a551d 100644
--- a/drivers/iio/dac/ad5592r-base.c
+++ b/drivers/iio/dac/ad5592r-base.c
@@ -484,7 +484,7 @@ static ssize_t ad5592r_show_scale_available(struct iio_dev *iio_dev,
st->scale_avail[1][0], st->scale_avail[1][1]);
}
-static struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
+static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
{
.name = "scale_available",
.read = ad5592r_show_scale_available,
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
` (2 preceding siblings ...)
2020-05-26 21:02 ` [PATCH 3/6] iio: dac: ad5592r-base: " Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-27 4:50 ` Ardelean, Alexandru
2020-05-26 21:02 ` [PATCH 5/6] iio: light: stk3310: Constify regmap_config Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default Rikard Falkeborn
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn, linux-pm,
Michael Hennerich
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>
---
drivers/iio/dac/ad5686.c | 8 ++++----
drivers/iio/dac/ad5686.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
index 8dd67da0a7da..6de48f618c95 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), \
diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
index 52009b5eef88..a15f2970577e 100644
--- a/drivers/iio/dac/ad5686.h
+++ b/drivers/iio/dac/ad5686.h
@@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state *st, u8 addr);
struct ad5686_chip_info {
u16 int_vref_mv;
unsigned int num_channels;
- struct iio_chan_spec *channels;
+ const struct iio_chan_spec *channels;
enum ad5686_regmap_type regmap_type;
};
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 5/6] iio: light: stk3310: Constify regmap_config
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
` (3 preceding siblings ...)
2020-05-26 21:02 ` [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-31 13:47 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default Rikard Falkeborn
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn
stk3310_regmap_config is not modified and can be made const to allow the
compiler to put it in read-only memory.
Before:
text data bss dec hex filename
16027 5424 128 21579 544b drivers/iio/light/stk3310.o
After:
text data bss dec hex filename
16347 5104 128 21579 544b drivers/iio/light/stk3310.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iio/light/stk3310.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index 185c24a75ae6..9d1e503bc958 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -487,7 +487,7 @@ static bool stk3310_is_volatile_reg(struct device *dev, unsigned int reg)
}
}
-static struct regmap_config stk3310_regmap_config = {
+static const struct regmap_config stk3310_regmap_config = {
.name = STK3310_REGMAP_NAME,
.reg_bits = 8,
.val_bits = 8,
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
` (4 preceding siblings ...)
2020-05-26 21:02 ` [PATCH 5/6] iio: light: stk3310: Constify regmap_config Rikard Falkeborn
@ 2020-05-26 21:02 ` Rikard Falkeborn
2020-05-31 13:48 ` Jonathan Cameron
5 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-05-26 21:02 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel, Rikard Falkeborn
mmc35240_reg_defaults is not modified and can be made const to allow the
compiler to put it in read-only memory.
Before:
text data bss dec hex filename
9759 3288 128 13175 3377 drivers/iio/magnetometer/mmc35240.o
After:
text data bss dec hex filename
9823 3224 128 13175 3377 drivers/iio/magnetometer/mmc35240.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/iio/magnetometer/mmc35240.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c
index 1787d656d009..f27586716b5c 100644
--- a/drivers/iio/magnetometer/mmc35240.c
+++ b/drivers/iio/magnetometer/mmc35240.c
@@ -459,7 +459,7 @@ static bool mmc35240_is_volatile_reg(struct device *dev, unsigned int reg)
}
}
-static struct reg_default mmc35240_reg_defaults[] = {
+static const struct reg_default mmc35240_reg_defaults[] = {
{ MMC35240_REG_CTRL0, 0x00 },
{ MMC35240_REG_CTRL1, 0x00 },
};
--
2.26.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info
2020-05-26 21:02 ` [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info Rikard Falkeborn
@ 2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-31 13:44 ` Jonathan Cameron
0 siblings, 1 reply; 18+ messages in thread
From: Ardelean, Alexandru @ 2020-05-27 4:22 UTC (permalink / raw)
To: rikard.falkeborn, jic23
Cc: linux-iio, Hennerich, Michael, knaack.h, lars, pmeerw, linux-kernel
On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> [External]
>
> ad5380_ext_info is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 12060 3280 192 15532 3cac drivers/iio/dac/ad5380.o
>
> After:
> text data bss dec hex filename
> 12252 3088 192 15532 3cac drivers/iio/dac/ad5380.o
>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> drivers/iio/dac/ad5380.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
> index b37e5675f716..04c74cc1a4ec 100644
> --- a/drivers/iio/dac/ad5380.c
> +++ b/drivers/iio/dac/ad5380.c
> @@ -240,7 +240,7 @@ static const struct iio_info ad5380_info = {
> .write_raw = ad5380_write_raw,
> };
>
> -static struct iio_chan_spec_ext_info ad5380_ext_info[] = {
> +static const struct iio_chan_spec_ext_info ad5380_ext_info[] = {
> {
> .name = "powerdown",
> .read = ad5380_read_dac_powerdown,
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/6] iio: dac: ad5592r-base: Constify struct iio_chan_spec_ext_info
2020-05-26 21:02 ` [PATCH 3/6] iio: dac: ad5592r-base: " Rikard Falkeborn
@ 2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-31 13:47 ` Jonathan Cameron
0 siblings, 1 reply; 18+ messages in thread
From: Ardelean, Alexandru @ 2020-05-27 4:22 UTC (permalink / raw)
To: rikard.falkeborn, jic23
Cc: linux-iio, Hennerich, Michael, knaack.h, lars, pmeerw, linux-kernel
On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> [External]
>
> ad5592r_ext_info is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 13293 2088 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
>
> After:
> text data bss dec hex filename
> 13421 1960 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> drivers/iio/dac/ad5592r-base.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-
> base.c
> index 410e90e5f75f..7402f67a551d 100644
> --- a/drivers/iio/dac/ad5592r-base.c
> +++ b/drivers/iio/dac/ad5592r-base.c
> @@ -484,7 +484,7 @@ static ssize_t ad5592r_show_scale_available(struct
> iio_dev *iio_dev,
> st->scale_avail[1][0], st->scale_avail[1][1]);
> }
>
> -static struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
> +static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
> {
> .name = "scale_available",
> .read = ad5592r_show_scale_available,
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec
2020-05-26 21:02 ` [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec Rikard Falkeborn
@ 2020-05-27 4:50 ` Ardelean, Alexandru
2020-05-31 13:47 ` Jonathan Cameron
0 siblings, 1 reply; 18+ messages in thread
From: Ardelean, Alexandru @ 2020-05-27 4:50 UTC (permalink / raw)
To: rikard.falkeborn, jic23
Cc: linux-iio, linux-pm, Hennerich, Michael, knaack.h, lars, pmeerw,
linux-kernel
On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> [External]
>
> 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
>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> drivers/iio/dac/ad5686.c | 8 ++++----
> drivers/iio/dac/ad5686.h | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> index 8dd67da0a7da..6de48f618c95 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), \
> diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
> index 52009b5eef88..a15f2970577e 100644
> --- a/drivers/iio/dac/ad5686.h
> +++ b/drivers/iio/dac/ad5686.h
> @@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state
> *st, u8 addr);
> struct ad5686_chip_info {
> u16 int_vref_mv;
> unsigned int num_channels;
> - struct iio_chan_spec *channels;
> + const struct iio_chan_spec *channels;
> enum ad5686_regmap_type regmap_type;
> };
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec
2020-05-26 21:02 ` [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Rikard Falkeborn
@ 2020-05-31 13:07 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:07 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel
On Tue, 26 May 2020 23:02:18 +0200
Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> max11100_channels is not modified and can therefore be made const to
> allow the compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 3776 1168 0 4944 1350 drivers/iio/adc/max11100.o
>
> After:
> text data bss dec hex filename
> 3968 976 0 4944 1350 drivers/iio/adc/max11100.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/adc/max11100.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c
> index 3440539cfdba..b121ca78f851 100644
> --- a/drivers/iio/adc/max11100.c
> +++ b/drivers/iio/adc/max11100.c
> @@ -37,7 +37,7 @@ struct max11100_state {
> u8 buffer[3] ____cacheline_aligned;
> };
>
> -static struct iio_chan_spec max11100_channels[] = {
> +static const struct iio_chan_spec max11100_channels[] = {
> { /* [0] */
> .type = IIO_VOLTAGE,
> .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info
2020-05-27 4:22 ` Ardelean, Alexandru
@ 2020-05-31 13:44 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:44 UTC (permalink / raw)
To: Ardelean, Alexandru
Cc: rikard.falkeborn, linux-iio, Hennerich, Michael, knaack.h, lars,
pmeerw, linux-kernel
On Wed, 27 May 2020 04:22:30 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > [External]
> >
> > ad5380_ext_info is not modified and can be made const to allow the
> > compiler to put it in read-only memory.
> >
> > Before:
> > text data bss dec hex filename
> > 12060 3280 192 15532 3cac drivers/iio/dac/ad5380.o
> >
> > After:
> > text data bss dec hex filename
> > 12252 3088 192 15532 3cac drivers/iio/dac/ad5380.o
> >
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
>
Applied.
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > ---
> > drivers/iio/dac/ad5380.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
> > index b37e5675f716..04c74cc1a4ec 100644
> > --- a/drivers/iio/dac/ad5380.c
> > +++ b/drivers/iio/dac/ad5380.c
> > @@ -240,7 +240,7 @@ static const struct iio_info ad5380_info = {
> > .write_raw = ad5380_write_raw,
> > };
> >
> > -static struct iio_chan_spec_ext_info ad5380_ext_info[] = {
> > +static const struct iio_chan_spec_ext_info ad5380_ext_info[] = {
> > {
> > .name = "powerdown",
> > .read = ad5380_read_dac_powerdown,
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec
2020-05-27 4:50 ` Ardelean, Alexandru
@ 2020-05-31 13:47 ` Jonathan Cameron
2020-08-18 19:30 ` Rikard Falkeborn
0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:47 UTC (permalink / raw)
To: Ardelean, Alexandru
Cc: rikard.falkeborn, linux-iio, linux-pm, Hennerich, Michael,
knaack.h, lars, pmeerw, linux-kernel
On Wed, 27 May 2020 04:50:46 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > [External]
> >
> > 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
> >
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
>
Applied.
thanks,
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > ---
> > drivers/iio/dac/ad5686.c | 8 ++++----
> > drivers/iio/dac/ad5686.h | 2 +-
> > 2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> > index 8dd67da0a7da..6de48f618c95 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), \
> > diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
> > index 52009b5eef88..a15f2970577e 100644
> > --- a/drivers/iio/dac/ad5686.h
> > +++ b/drivers/iio/dac/ad5686.h
> > @@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state
> > *st, u8 addr);
> > struct ad5686_chip_info {
> > u16 int_vref_mv;
> > unsigned int num_channels;
> > - struct iio_chan_spec *channels;
> > + const struct iio_chan_spec *channels;
> > enum ad5686_regmap_type regmap_type;
> > };
> >
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/6] iio: dac: ad5592r-base: Constify struct iio_chan_spec_ext_info
2020-05-27 4:22 ` Ardelean, Alexandru
@ 2020-05-31 13:47 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:47 UTC (permalink / raw)
To: Ardelean, Alexandru
Cc: rikard.falkeborn, linux-iio, Hennerich, Michael, knaack.h, lars,
pmeerw, linux-kernel
On Wed, 27 May 2020 04:22:46 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > [External]
> >
> > ad5592r_ext_info is not modified and can be made const to allow the
> > compiler to put it in read-only memory.
> >
> > Before:
> > text data bss dec hex filename
> > 13293 2088 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
> >
> > After:
> > text data bss dec hex filename
> > 13421 1960 256 15637 3d15 drivers/iio/dac/ad5592r-base.o
> >
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied.
Thanks
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > ---
> > drivers/iio/dac/ad5592r-base.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-
> > base.c
> > index 410e90e5f75f..7402f67a551d 100644
> > --- a/drivers/iio/dac/ad5592r-base.c
> > +++ b/drivers/iio/dac/ad5592r-base.c
> > @@ -484,7 +484,7 @@ static ssize_t ad5592r_show_scale_available(struct
> > iio_dev *iio_dev,
> > st->scale_avail[1][0], st->scale_avail[1][1]);
> > }
> >
> > -static struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
> > +static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
> > {
> > .name = "scale_available",
> > .read = ad5592r_show_scale_available,
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/6] iio: light: stk3310: Constify regmap_config
2020-05-26 21:02 ` [PATCH 5/6] iio: light: stk3310: Constify regmap_config Rikard Falkeborn
@ 2020-05-31 13:47 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:47 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel
On Tue, 26 May 2020 23:02:22 +0200
Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> stk3310_regmap_config is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 16027 5424 128 21579 544b drivers/iio/light/stk3310.o
>
> After:
> text data bss dec hex filename
> 16347 5104 128 21579 544b drivers/iio/light/stk3310.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Applied.
thanks,
Jonathan
> ---
> drivers/iio/light/stk3310.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index 185c24a75ae6..9d1e503bc958 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -487,7 +487,7 @@ static bool stk3310_is_volatile_reg(struct device *dev, unsigned int reg)
> }
> }
>
> -static struct regmap_config stk3310_regmap_config = {
> +static const struct regmap_config stk3310_regmap_config = {
> .name = STK3310_REGMAP_NAME,
> .reg_bits = 8,
> .val_bits = 8,
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default
2020-05-26 21:02 ` [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default Rikard Falkeborn
@ 2020-05-31 13:48 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-05-31 13:48 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel
On Tue, 26 May 2020 23:02:23 +0200
Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> mmc35240_reg_defaults is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
> text data bss dec hex filename
> 9759 3288 128 13175 3377 drivers/iio/magnetometer/mmc35240.o
>
> After:
> text data bss dec hex filename
> 9823 3224 128 13175 3377 drivers/iio/magnetometer/mmc35240.o
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/magnetometer/mmc35240.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c
> index 1787d656d009..f27586716b5c 100644
> --- a/drivers/iio/magnetometer/mmc35240.c
> +++ b/drivers/iio/magnetometer/mmc35240.c
> @@ -459,7 +459,7 @@ static bool mmc35240_is_volatile_reg(struct device *dev, unsigned int reg)
> }
> }
>
> -static struct reg_default mmc35240_reg_defaults[] = {
> +static const struct reg_default mmc35240_reg_defaults[] = {
> { MMC35240_REG_CTRL0, 0x00 },
> { MMC35240_REG_CTRL1, 0x00 },
> };
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec
2020-05-31 13:47 ` Jonathan Cameron
@ 2020-08-18 19:30 ` Rikard Falkeborn
2020-08-22 10:31 ` Jonathan Cameron
0 siblings, 1 reply; 18+ messages in thread
From: Rikard Falkeborn @ 2020-08-18 19:30 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Ardelean, Alexandru, rikard.falkeborn, linux-iio, linux-pm,
Hennerich, Michael, knaack.h, lars, pmeerw, linux-kernel
On Sun, May 31, 2020 at 02:47:15PM +0100, Jonathan Cameron wrote:
> On Wed, 27 May 2020 04:50:46 +0000
> "Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
>
> > On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > > [External]
> > >
> > > 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
> > >
> >
> > Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> >
> Applied.
>
> thanks,
Was this one really applied? I can't see it anywhere? The rest of the
patches in the series are in Linus' tree.
Rikard
>
> > > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > > ---
> > > drivers/iio/dac/ad5686.c | 8 ++++----
> > > drivers/iio/dac/ad5686.h | 2 +-
> > > 2 files changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> > > index 8dd67da0a7da..6de48f618c95 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), \
> > > diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
> > > index 52009b5eef88..a15f2970577e 100644
> > > --- a/drivers/iio/dac/ad5686.h
> > > +++ b/drivers/iio/dac/ad5686.h
> > > @@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state
> > > *st, u8 addr);
> > > struct ad5686_chip_info {
> > > u16 int_vref_mv;
> > > unsigned int num_channels;
> > > - struct iio_chan_spec *channels;
> > > + const struct iio_chan_spec *channels;
> > > enum ad5686_regmap_type regmap_type;
> > > };
> > >
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec
2020-08-18 19:30 ` Rikard Falkeborn
@ 2020-08-22 10:31 ` Jonathan Cameron
0 siblings, 0 replies; 18+ messages in thread
From: Jonathan Cameron @ 2020-08-22 10:31 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Ardelean, Alexandru, linux-iio, linux-pm, Hennerich, Michael,
knaack.h, lars, pmeerw, linux-kernel
On Tue, 18 Aug 2020 21:30:17 +0200
Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> On Sun, May 31, 2020 at 02:47:15PM +0100, Jonathan Cameron wrote:
> > On Wed, 27 May 2020 04:50:46 +0000
> > "Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> >
> > > On Tue, 2020-05-26 at 23:02 +0200, Rikard Falkeborn wrote:
> > > > [External]
> > > >
> > > > 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
> > > >
> > >
> > > Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > >
> > Applied.
> >
> > thanks,
>
> Was this one really applied? I can't see it anywhere? The rest of the
> patches in the series are in Linus' tree.
>
No idea what happened here. Now applied to the togreg branch of iio.git
and pushed out as testing. Sorry about that!
Jonathan
> Rikard
>
> >
> > > > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > > > ---
> > > > drivers/iio/dac/ad5686.c | 8 ++++----
> > > > drivers/iio/dac/ad5686.h | 2 +-
> > > > 2 files changed, 5 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> > > > index 8dd67da0a7da..6de48f618c95 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), \
> > > > diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
> > > > index 52009b5eef88..a15f2970577e 100644
> > > > --- a/drivers/iio/dac/ad5686.h
> > > > +++ b/drivers/iio/dac/ad5686.h
> > > > @@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state
> > > > *st, u8 addr);
> > > > struct ad5686_chip_info {
> > > > u16 int_vref_mv;
> > > > unsigned int num_channels;
> > > > - struct iio_chan_spec *channels;
> > > > + const struct iio_chan_spec *channels;
> > > > enum ad5686_regmap_type regmap_type;
> > > > };
> > > >
> >
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2020-08-22 10:31 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 21:02 [PATCH 0/6] drivers/iio: Constify structs Rikard Falkeborn
2020-05-26 21:02 ` [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Rikard Falkeborn
2020-05-31 13:07 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info Rikard Falkeborn
2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-31 13:44 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 3/6] iio: dac: ad5592r-base: " Rikard Falkeborn
2020-05-27 4:22 ` Ardelean, Alexandru
2020-05-31 13:47 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec Rikard Falkeborn
2020-05-27 4:50 ` Ardelean, Alexandru
2020-05-31 13:47 ` Jonathan Cameron
2020-08-18 19:30 ` Rikard Falkeborn
2020-08-22 10:31 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 5/6] iio: light: stk3310: Constify regmap_config Rikard Falkeborn
2020-05-31 13:47 ` Jonathan Cameron
2020-05-26 21:02 ` [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default Rikard Falkeborn
2020-05-31 13:48 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).