Skip to content

Commit 7e17ce3

Browse files
dlechjic23
authored andcommitted
iio: pressure: abp060mg: make abp_config const
Add const qualifier to struct abp_config abp_config[]. This is read-only data so it can be made const. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250628-iio-const-data-23-v1-1-542cfadce9d0@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent efabcb3 commit 7e17ce3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/pressure/abp060mg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct abp_config {
3535
int max;
3636
};
3737

38-
static struct abp_config abp_config[] = {
38+
static const struct abp_config abp_config[] = {
3939
/* mbar & kPa variants */
4040
[ABP006KG] = { .min = 0, .max = 6000 },
4141
[ABP010KG] = { .min = 0, .max = 10000 },
@@ -165,7 +165,7 @@ static const struct iio_info abp060mg_info = {
165165
static void abp060mg_init_device(struct iio_dev *indio_dev, unsigned long id)
166166
{
167167
struct abp_state *state = iio_priv(indio_dev);
168-
struct abp_config *cfg = &abp_config[id];
168+
const struct abp_config *cfg = &abp_config[id];
169169

170170
state->scale = cfg->max - cfg->min;
171171
state->offset = -ABP060MG_MIN_COUNTS;

0 commit comments

Comments
 (0)