lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec
Date
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
\
 
 \ /
  Last update: 2020-05-26 23:05    [W:2.451 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site