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]
Date:   Fri, 21 Jan 2022 13:54:11 -0300
From:   Luiz Sampaio <sampaio.ime@...il.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Miloslav Trmac <mitr@...ny.cz>
Cc:     linux-kernel@...r.kernel.org, Luiz Sampaio <sampaio.ime@...il.com>,
        linux-input@...r.kernel.org
Subject: [PATCH 06/31] input: misc: changing LED_* from enum led_brightness to actual value

The enum led_brightness, which contains the declaration of LED_OFF,
LED_ON, LED_HALF and LED_FULL is obsolete, as the led class now supports
max_brightness.
---
 drivers/input/misc/apanel.c       | 4 ++--
 drivers/input/misc/ims-pcu.c      | 2 +-
 drivers/input/misc/wistron_btns.c | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/input/misc/apanel.c b/drivers/input/misc/apanel.c
index 7276657ad7ca..3b7e2f032f33 100644
--- a/drivers/input/misc/apanel.c
+++ b/drivers/input/misc/apanel.c
@@ -115,7 +115,7 @@ static int mail_led_set(struct led_classdev *led,
 			 enum led_brightness value)
 {
 	struct apanel *ap = container_of(led, struct apanel, mail_led);
-	u16 led_bits = value != LED_OFF ? 0x8000 : 0x0000;
+	u16 led_bits = value != 0 ? 0x8000 : 0x0000;
 
 	return i2c_smbus_write_word_data(ap->client, 0x10, led_bits);
 }
@@ -189,7 +189,7 @@ static void apanel_shutdown(struct i2c_client *client)
 	struct apanel *ap = i2c_get_clientdata(client);
 
 	if (device_chip[APANEL_DEV_LED] != CHIP_NONE)
-		led_set_brightness(&ap->mail_led, LED_OFF);
+		led_set_brightness(&ap->mail_led, 0);
 }
 
 static const struct i2c_device_id apanel_id[] = {
diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
index 6f38aa23a1ff..9665f371837d 100644
--- a/drivers/input/misc/ims-pcu.c
+++ b/drivers/input/misc/ims-pcu.c
@@ -986,7 +986,7 @@ ims_pcu_backlight_get_brightness(struct led_classdev *cdev)
 			 "Failed to get current brightness, error: %d\n",
 			 error);
 		/* Assume the LED is OFF */
-		brightness = LED_OFF;
+		brightness = 0;
 	} else {
 		brightness =
 			get_unaligned_le16(&pcu->cmd_buf[IMS_PCU_DATA_OFFSET]);
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 80dfd72a02d3..cd290722a389 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -1039,14 +1039,14 @@ static bool bluetooth_enabled;
 static void wistron_mail_led_set(struct led_classdev *led_cdev,
 				enum led_brightness value)
 {
-	bios_set_state(MAIL_LED, (value != LED_OFF) ? 1 : 0);
+	bios_set_state(MAIL_LED, (value != 0) ? 1 : 0);
 }
 
 /* same as setting up wifi card, but for laptops on which the led is managed */
 static void wistron_wifi_led_set(struct led_classdev *led_cdev,
 				enum led_brightness value)
 {
-	bios_set_state(WIFI, (value != LED_OFF) ? 1 : 0);
+	bios_set_state(WIFI, (value != 0) ? 1 : 0);
 }
 
 static struct led_classdev wistron_mail_led = {
@@ -1064,7 +1064,7 @@ static void wistron_led_init(struct device *parent)
 	if (leds_present & FE_WIFI_LED) {
 		u16 wifi = bios_get_default_setting(WIFI);
 		if (wifi & 1) {
-			wistron_wifi_led.brightness = (wifi & 2) ? LED_FULL : LED_OFF;
+			wistron_wifi_led.brightness = (wifi & 2) ? LED_FULL : 0;
 			if (led_classdev_register(parent, &wistron_wifi_led))
 				leds_present &= ~FE_WIFI_LED;
 			else
@@ -1076,7 +1076,7 @@ static void wistron_led_init(struct device *parent)
 
 	if (leds_present & FE_MAIL_LED) {
 		/* bios_get_default_setting(MAIL) always retuns 0, so just turn the led off */
-		wistron_mail_led.brightness = LED_OFF;
+		wistron_mail_led.brightness = 0;
 		if (led_classdev_register(parent, &wistron_mail_led))
 			leds_present &= ~FE_MAIL_LED;
 		else
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ