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: <20231109104748.2746839-2-m.szyprowski@samsung.com>
Date:   Thu,  9 Nov 2023 11:47:48 +0100
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-pwm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
Subject: [PATCH 2/2] pwm: Clarify PWMF_* enums definition

PWMF_* enums are defined as flag values (like 1 << n), but then in the
code they are used as bit numbers via set/test/clear_bit() macros. Change
their values to sequential numbers to clearly show that they are bit
numbers, not the flag values.

Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
---
 include/linux/pwm.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index e3b437587b32..95c895c63cf6 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -40,9 +40,12 @@ struct pwm_args {
 	enum pwm_polarity polarity;
 };
 
-enum {
-	PWMF_REQUESTED = 1 << 0,
-	PWMF_EXPORTED = 1 << 1,
+/**
+ * enum pwm_flags_bits - status bits for pwm->flags entry
+ */
+enum pwm_flags_bits {
+	PWMF_REQUESTED = 0,
+	PWMF_EXPORTED = 1,
 };
 
 /*
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ