mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_lightbar: fix const correctness of seqname array
@ 2026-02-08 10:00 trunix-creator
  2026-02-23  8:17 ` Tzung-Bi Shih
  0 siblings, 1 reply; 2+ messages in thread
From: trunix-creator @ 2026-02-08 10:00 UTC (permalink / raw)
  To: bleung, tzungbi; +Cc: chrome-platform, linux-kernel, trunix-creator

The seqname array was declared as 'char const *seqname[]',
And since the array is intended to be fully immutable, It is now corrected
to 'const char * const seqname[]' to mark both the strings and the pointer array as read-only.

This improves const correctness and matches the intended usage of the
sequence name table.

Signed-off-by: trunix-creator <trunixcodes@zohomail.com>
---
 drivers/platform/chrome/cros_ec_lightbar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c
index 8352e9732791..922758c2cec1 100644
--- a/drivers/platform/chrome/cros_ec_lightbar.c
+++ b/drivers/platform/chrome/cros_ec_lightbar.c
@@ -283,7 +283,7 @@ static ssize_t led_rgb_store(struct device *dev, struct device_attribute *attr,
 	return (ok && i == 0) ? count : -EINVAL;
 }
 
-static char const *seqname[] = {
+static const char * const seqname[] = {
 	"ERROR", "S5", "S3", "S0", "S5S3", "S3S0",
 	"S0S3", "S3S5", "STOP", "RUN", "KONAMI",
 	"TAP", "PROGRAM",
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_lightbar: fix const correctness of seqname array
  2026-02-08 10:00 [PATCH] platform/chrome: cros_ec_lightbar: fix const correctness of seqname array trunix-creator
@ 2026-02-23  8:17 ` Tzung-Bi Shih
  0 siblings, 0 replies; 2+ messages in thread
From: Tzung-Bi Shih @ 2026-02-23  8:17 UTC (permalink / raw)
  To: trunix-creator; +Cc: bleung, chrome-platform, linux-kernel

On Sun, Feb 08, 2026 at 02:00:49AM -0800, trunix-creator wrote:
> The seqname array was declared as 'char const *seqname[]',
> And since the array is intended to be fully immutable, It is now corrected
> to 'const char * const seqname[]' to mark both the strings and the pointer array as read-only.
> 
> This improves const correctness and matches the intended usage of the
> sequence name table.
> 
> Signed-off-by: trunix-creator <trunixcodes@zohomail.com>

Thanks for the patch.

Before this can be considered for merging, you'll need to update the
Signed-off-by line.  The kernel community requires the use of your real
name (legal name) rather than a handle (see also "Developer's Certificate
of Origin" in Documentation/process/submitting-patches.rst).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-23  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-08 10:00 [PATCH] platform/chrome: cros_ec_lightbar: fix const correctness of seqname array trunix-creator
2026-02-23  8:17 ` Tzung-Bi Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®