public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Csókás, Bence" <csokas.bence@prolan.hu>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: "Csókás, Bence" <csokas.bence@prolan.hu>,
	trivial@kernel.org, "Andrew Lunn" <andrew@lunn.ch>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>
Subject: [RFC PATCH 2/2] net: include: mii: Refactor: Use BIT() for ADVERTISE_* bits
Date: Wed, 5 Jun 2024 14:16:49 +0200	[thread overview]
Message-ID: <20240605121648.69779-2-csokas.bence@prolan.hu> (raw)
In-Reply-To: <20240605121648.69779-1-csokas.bence@prolan.hu>

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

Cc: trivial@kernel.org

Signed-off-by: "Csókás, Bence" <csokas.bence@prolan.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



  reply	other threads:[~2024-06-05 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 12:16 [RFC PATCH 1/2] net: include: mii: Refactor: Define LPA_* in terms of ADVERTISE_* Csókás, Bence
2024-06-05 12:16 ` Csókás, Bence [this message]
2024-06-05 14:13   ` [RFC PATCH 2/2] net: include: mii: Refactor: Use BIT() for ADVERTISE_* bits Vladimir Oltean
2024-06-05 14:47     ` Csókás Bence
2024-06-05 15:31       ` Vladimir Oltean
2024-06-05 16:48       ` Andrew Lunn
2024-06-05 12:51 ` [RFC PATCH 1/2] net: include: mii: Refactor: Define LPA_* in terms of ADVERTISE_* Andrew Lunn
2024-06-05 13:37   ` Csókás Bence

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605121648.69779-2-csokas.bence@prolan.hu \
    --to=csokas.bence@prolan.hu \
    --cc=andrew@lunn.ch \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox