* [PATCH] iio: light: zopt2201: make zopt2201_scale const
@ 2025-06-28 17:56 David Lechner
2025-06-29 17:18 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: David Lechner @ 2025-06-28 17:56 UTC (permalink / raw)
To: Jonathan Cameron, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, David Lechner
Add const qualifier to struct zopt2201_scale zopt2201_scale_*[]. This
is read-only data so it can be made const.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/light/zopt2201.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/zopt2201.c b/drivers/iio/light/zopt2201.c
index 1e5e9bf2935f63f9af4cdbf29f825b218ec477be..1dba1b949cc32d2897d8acdd2f981d8a919e7da2 100644
--- a/drivers/iio/light/zopt2201.c
+++ b/drivers/iio/light/zopt2201.c
@@ -119,7 +119,7 @@ struct zopt2201_scale {
u8 res; /* resolution register value */
};
-static struct zopt2201_scale zopt2201_scale_als[] = {
+static const struct zopt2201_scale zopt2201_scale_als[] = {
{ 19, 200000, 0, 5 },
{ 6, 400000, 1, 5 },
{ 3, 200000, 2, 5 },
@@ -144,7 +144,7 @@ static struct zopt2201_scale zopt2201_scale_als[] = {
{ 0, 8333, 4, 0 },
};
-static struct zopt2201_scale zopt2201_scale_uvb[] = {
+static const struct zopt2201_scale zopt2201_scale_uvb[] = {
{ 0, 460800, 0, 5 },
{ 0, 153600, 1, 5 },
{ 0, 76800, 2, 5 },
@@ -347,7 +347,7 @@ static int zopt2201_set_gain(struct zopt2201_data *data, u8 gain)
}
static int zopt2201_write_scale_by_idx(struct zopt2201_data *data, int idx,
- struct zopt2201_scale *zopt2201_scale_array)
+ const struct zopt2201_scale *zopt2201_scale_array)
{
int ret;
---
base-commit: 14071b9cf2d751ff9bc8b5e43fa94fbf08aceea1
change-id: 20250628-iio-const-data-22-6ee81716e95b
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: light: zopt2201: make zopt2201_scale const
2025-06-28 17:56 [PATCH] iio: light: zopt2201: make zopt2201_scale const David Lechner
@ 2025-06-29 17:18 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2025-06-29 17:18 UTC (permalink / raw)
To: David Lechner; +Cc: Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel
On Sat, 28 Jun 2025 12:56:30 -0500
David Lechner <dlechner@baylibre.com> wrote:
> Add const qualifier to struct zopt2201_scale zopt2201_scale_*[]. 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:18 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:56 [PATCH] iio: light: zopt2201: make zopt2201_scale const David Lechner
2025-06-29 17:18 ` 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).