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: Wed, 5 Jun 2024 14:16:49 +0200
From: Csókás, Bence <csokas.bence@...lan.hu>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Csókás, Bence <csokas.bence@...lan.hu>,
	<trivial@...nel.org>, Andrew Lunn <andrew@...n.ch>, Heiner Kallweit
	<hkallweit1@...il.com>, Russell King <linux@...linux.org.uk>
Subject: [RFC PATCH 2/2] net: include: mii: Refactor: Use BIT() for ADVERTISE_* bits

Replace hex values with BIT() and GENMASK() for readability

Cc: trivial@...nel.org

Signed-off-by: "Csókás, Bence" <csokas.bence@...lan.hu>
---
 include/uapi/linux/mii.h | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/uapi/linux/mii.h b/include/uapi/linux/mii.h
index 33e1b0c717e4..f03ac3b35850 100644
--- a/include/uapi/linux/mii.h
+++ b/include/uapi/linux/mii.h
@@ -69,23 +69,23 @@
 #define BMSR_100BASE4		0x8000	/* Can do 100mbps, 4k packets  */
 
 /* Advertisement control register. */
-#define ADVERTISE_SLCT		0x001f	/* Selector bits               */
-#define ADVERTISE_CSMA		0x0001	/* Only selector supported     */
-#define ADVERTISE_10HALF	0x0020	/* Try for 10mbps half-duplex  */
-#define ADVERTISE_1000XFULL	0x0020	/* Try for 1000BASE-X full-duplex */
-#define ADVERTISE_10FULL	0x0040	/* Try for 10mbps full-duplex  */
-#define ADVERTISE_1000XHALF	0x0040	/* Try for 1000BASE-X half-duplex */
-#define ADVERTISE_100HALF	0x0080	/* Try for 100mbps half-duplex */
-#define ADVERTISE_1000XPAUSE	0x0080	/* Try for 1000BASE-X pause    */
-#define ADVERTISE_100FULL	0x0100	/* Try for 100mbps full-duplex */
-#define ADVERTISE_1000XPSE_ASYM	0x0100	/* Try for 1000BASE-X asym pause */
-#define ADVERTISE_100BASE4	0x0200	/* Try for 100mbps 4k packets  */
-#define ADVERTISE_PAUSE_CAP	0x0400	/* Try for pause               */
-#define ADVERTISE_PAUSE_ASYM	0x0800	/* Try for asymetric pause     */
-#define ADVERTISE_RESV		0x1000	/* Unused...                   */
-#define ADVERTISE_RFAULT	0x2000	/* Say we can detect faults    */
-#define ADVERTISE_LPACK		0x4000	/* Ack link partners response  */
-#define ADVERTISE_NPAGE		0x8000	/* Next page bit               */
+#define ADVERTISE_SLCT		GENMASK(4, 0)	/* Selector bits               */
+#define ADVERTISE_CSMA		BIT(0)	/* Only selector supported     */
+#define ADVERTISE_10HALF	BIT(5)	/* Try for 10mbps half-duplex  */
+#define ADVERTISE_1000XFULL	BIT(5)	/* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL	BIT(6)	/* Try for 10mbps full-duplex  */
+#define ADVERTISE_1000XHALF	BIT(6)	/* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF	BIT(7)	/* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE	BIT(7)	/* Try for 1000BASE-X pause    */
+#define ADVERTISE_100FULL	BIT(8)	/* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM	BIT(8)	/* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4	BIT(9)	/* Try for 100mbps 4k packets  */
+#define ADVERTISE_PAUSE_CAP	BIT(10)	/* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM	BIT(11)	/* Try for asymmetric pause     */
+#define ADVERTISE_RESV		BIT(12)	/* Unused...                   */
+#define ADVERTISE_RFAULT	BIT(13)	/* Say we can detect faults    */
+#define ADVERTISE_LPACK		BIT(14)	/* Ack link partners response  */
+#define ADVERTISE_NPAGE		BIT(15)	/* Next page bit               */
 
 #define ADVERTISE_FULL		(ADVERTISE_100FULL | ADVERTISE_10FULL | \
 				  ADVERTISE_CSMA)
-- 
2.34.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ