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:   Tue,  7 Jun 2022 20:46:34 +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>
Subject: [PATCH 3/4] platform/x86: compal-laptop: Use backlight helper

Instead of manually checking the power state in struct
backlight_properties, use backlight_is_blank().

Signed-off-by: Stephen Kitt <steve@....org>
Cc: Cezary Jackiewicz <cezary.jackiewicz@...il.com>
Cc: Hans de Goede <hdegoede@...hat.com>
Cc: Mark Gross <markgross@...nel.org>
Cc: platform-driver-x86@...r.kernel.org
---
 drivers/platform/x86/compal-laptop.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index ab610376fdad..0942f50bd793 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -324,9 +324,7 @@ static int bl_update_status(struct backlight_device *b)
 	if (ret)
 		return ret;
 
-	set_backlight_state((b->props.power == FB_BLANK_UNBLANK)
-		&&    !(b->props.state & BL_CORE_SUSPENDED)
-		&&    !(b->props.state & BL_CORE_FBBLANK));
+	set_backlight_state(!backlight_is_blank(b));
 	return 0;
 }
 
-- 
2.30.2

Powered by blists - more mailing lists