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: <20220607184635.1127913-5-steve@sk2.org>
Date:   Tue,  7 Jun 2022 20:46:35 +0200
From:   Stephen Kitt <steve@....org>
To:     "Lee, Chun-Yi" <jlee@...e.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        Cezary Jackiewicz <cezary.jackiewicz@...il.com>,
        Henrique de Moraes Holschuh <hmh@....eng.br>
Cc:     platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
        Stephen Kitt <steve@....org>,
        ibm-acpi-devel@...ts.sourceforge.net
Subject: [PATCH 4/4] platform/x86: thinkpad_acpi: Use backlight helper

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@....org>
Cc: Henrique de Moraes Holschuh <hmh@....eng.br>
Cc: Hans de Goede <hdegoede@...hat.com>
Cc: Mark Gross <markgross@...nel.org>
Cc: ibm-acpi-devel@...ts.sourceforge.net
Cc: platform-driver-x86@...r.kernel.org
---
 drivers/platform/x86/thinkpad_acpi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e6cb4a14cdd4..a9337bd1d125 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6796,10 +6796,7 @@ static int brightness_set(unsigned int value)
 
 static int brightness_update_status(struct backlight_device *bd)
 {
-	unsigned int level =
-		(bd->props.fb_blank == FB_BLANK_UNBLANK &&
-		 bd->props.power == FB_BLANK_UNBLANK) ?
-				bd->props.brightness : 0;
+	int level = backlight_get_brightness(bd);
 
 	dbg_printk(TPACPI_DBG_BRGHT,
 			"backlight: attempt to set level to %d\n",
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ