* [PATCH] iio: pressure: abp060mg: make abp_config const
@ 2025-06-28 17:58 David Lechner
2025-06-29 17:19 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: David Lechner @ 2025-06-28 17:58 UTC (permalink / raw)
To: Jonathan Cameron, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, David Lechner
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>
---
drivers/iio/pressure/abp060mg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/pressure/abp060mg.c b/drivers/iio/pressure/abp060mg.c
index a0d956c3e2543f353ff0c157e01312645653573a..699b0fd64985d700fbfe3e6d93fbbe5bbb8ee8cb 100644
--- a/drivers/iio/pressure/abp060mg.c
+++ b/drivers/iio/pressure/abp060mg.c
@@ -35,7 +35,7 @@ struct abp_config {
int max;
};
-static struct abp_config abp_config[] = {
+static const struct abp_config abp_config[] = {
/* mbar & kPa variants */
[ABP006KG] = { .min = 0, .max = 6000 },
[ABP010KG] = { .min = 0, .max = 10000 },
@@ -165,7 +165,7 @@ static const struct iio_info abp060mg_info = {
static void abp060mg_init_device(struct iio_dev *indio_dev, unsigned long id)
{
struct abp_state *state = iio_priv(indio_dev);
- struct abp_config *cfg = &abp_config[id];
+ const struct abp_config *cfg = &abp_config[id];
state->scale = cfg->max - cfg->min;
state->offset = -ABP060MG_MIN_COUNTS;
---
base-commit: 14071b9cf2d751ff9bc8b5e43fa94fbf08aceea1
change-id: 20250628-iio-const-data-23-fcd0c629bc83
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: pressure: abp060mg: make abp_config const
2025-06-28 17:58 [PATCH] iio: pressure: abp060mg: make abp_config const David Lechner
@ 2025-06-29 17:19 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2025-06-29 17:19 UTC (permalink / raw)
To: David Lechner; +Cc: Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel
On Sat, 28 Jun 2025 12:58:11 -0500
David Lechner <dlechner@baylibre.com> wrote:
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-29 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28 17:58 [PATCH] iio: pressure: abp060mg: make abp_config const David Lechner
2025-06-29 17:19 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox