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: <20220121165436.30956-2-sampaio.ime@gmail.com>
Date:   Fri, 21 Jan 2022 13:54:06 -0300
From:   Luiz Sampaio <sampaio.ime@...il.com>
To:     Ben Skeggs <bskeggs@...hat.com>, Karol Herbst <kherbst@...hat.com>,
        Lyude Paul <lyude@...hat.com>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>
Cc:     linux-kernel@...r.kernel.org, Luiz Sampaio <sampaio.ime@...il.com>,
        dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org
Subject: [PATCH 01/31] gpu: nouveau: nouveau_led: changing LED_FULL 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/gpu/drm/nouveau/nouveau_led.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_led.c b/drivers/gpu/drm/nouveau/nouveau_led.c
index 2c5e0628da12..df4a734510e1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_led.c
+++ b/drivers/gpu/drm/nouveau/nouveau_led.c
@@ -45,7 +45,7 @@ nouveau_led_get_brightness(struct led_classdev *led)
 	duty = nvif_rd32(device, 0x61c884) & 0x00ffffff;
 
 	if (div > 0)
-		return duty * LED_FULL / div;
+		return duty * 255 / div;
 	else
 		return 0;
 }
@@ -62,7 +62,7 @@ nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value)
 	u32 div, duty;
 
 	div = input_clk / freq;
-	duty = value * div / LED_FULL;
+	duty = value * div / 255;
 
 	/* for now, this is safe to directly poke those registers because:
 	 *  - A: nvidia never puts the logo led to any other PWM controler
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ