lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240613-cros_ec-led-v3-2-500b50f41e0f@weissschuh.net>
Date: Thu, 13 Jun 2024 16:48:37 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>, 
 Thomas Weißschuh <thomas@...ssschuh.net>, 
 Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>, 
 Tzung-Bi Shih <tzungbi@...nel.org>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org, 
 chrome-platform@...ts.linux.dev, Dustin Howett <dustin@...ett.net>, 
 Mario Limonciello <mario.limonciello@....com>, 
 Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH v3 2/5] leds: multicolor: Use led_get_color_name() function

led_get_color_name() is a safer alternative to led_colors.

led-class-multicolor.c is the only external user of led_colors and its
removal allows unexporting the array.

Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
 drivers/leds/led-class-multicolor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c
index ec62a4811613..584e3786a1e7 100644
--- a/drivers/leds/led-class-multicolor.c
+++ b/drivers/leds/led-class-multicolor.c
@@ -101,7 +101,7 @@ static ssize_t multi_index_show(struct device *dev,
 
 	for (i = 0; i < mcled_cdev->num_colors; i++) {
 		index = mcled_cdev->subled_info[i].color_index;
-		len += sprintf(buf + len, "%s", led_colors[index]);
+		len += sprintf(buf + len, "%s", led_get_color_name(index));
 		if (i < mcled_cdev->num_colors - 1)
 			len += sprintf(buf + len, " ");
 	}

-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ