From: Qasim Ijaz <qasdev00@gmail.com>
To: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] net: ch9200: use BIT macro for bitmask constants
Date: Fri, 6 Jun 2025 17:07:23 +0100 [thread overview]
Message-ID: <20250606160723.12679-1-qasdev00@gmail.com> (raw)
Use the BIT() macro for bitmask constants.
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
---
drivers/net/usb/ch9200.c | 50 ++++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/net/usb/ch9200.c b/drivers/net/usb/ch9200.c
index a206ffa76f1b..bfe27a7dcbb4 100644
--- a/drivers/net/usb/ch9200.c
+++ b/drivers/net/usb/ch9200.c
@@ -59,42 +59,42 @@
*
* Note: bits 13 and 15 are reserved
*/
-#define LOOPBACK (0x01 << 14)
-#define BASE100X (0x01 << 12)
-#define MBPS_10 (0x01 << 11)
-#define DUPLEX_MODE (0x01 << 10)
-#define PAUSE_FRAME (0x01 << 9)
-#define PROMISCUOUS (0x01 << 8)
-#define MULTICAST (0x01 << 7)
-#define BROADCAST (0x01 << 6)
-#define HASH (0x01 << 5)
-#define APPEND_PAD (0x01 << 4)
-#define APPEND_CRC (0x01 << 3)
-#define TRANSMITTER_ACTION (0x01 << 2)
-#define RECEIVER_ACTION (0x01 << 1)
-#define DMA_ACTION (0x01 << 0)
+#define LOOPBACK BIT(14)
+#define BASE100X BIT(12)
+#define MBPS_10 BIT(11)
+#define DUPLEX_MODE BIT(10)
+#define PAUSE_FRAME BIT(9)
+#define PROMISCUOUS BIT(8)
+#define MULTICAST BIT(7)
+#define BROADCAST BIT(6)
+#define HASH BIT(5)
+#define APPEND_PAD BIT(4)
+#define APPEND_CRC BIT(3)
+#define TRANSMITTER_ACTION BIT(2)
+#define RECEIVER_ACTION BIT(1)
+#define DMA_ACTION BIT(0)
/* Status register bits
*
* Note: bits 7-15 are reserved
*/
-#define ALIGNMENT (0x01 << 6)
-#define FIFO_OVER_RUN (0x01 << 5)
-#define FIFO_UNDER_RUN (0x01 << 4)
-#define RX_ERROR (0x01 << 3)
-#define RX_COMPLETE (0x01 << 2)
-#define TX_ERROR (0x01 << 1)
-#define TX_COMPLETE (0x01 << 0)
+#define ALIGNMENT BIT(6)
+#define FIFO_OVER_RUN BIT(5)
+#define FIFO_UNDER_RUN BIT(4)
+#define RX_ERROR BIT(3)
+#define RX_COMPLETE BIT(2)
+#define TX_ERROR BIT(1)
+#define TX_COMPLETE BIT(0)
/* FIFO depth register bits
*
* Note: bits 6 and 14 are reserved
*/
-#define ETH_TXBD (0x01 << 15)
-#define ETN_TX_FIFO_DEPTH (0x01 << 8)
-#define ETH_RXBD (0x01 << 7)
-#define ETH_RX_FIFO_DEPTH (0x01 << 0)
+#define ETH_TXBD BIT(15)
+#define ETN_TX_FIFO_DEPTH BIT(8)
+#define ETH_RXBD BIT(7)
+#define ETH_RX_FIFO_DEPTH BIT(0)
static int control_read(struct usbnet *dev,
unsigned char request, unsigned short value,
--
2.39.5
next reply other threads:[~2025-06-06 16:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 16:07 Qasim Ijaz [this message]
2025-06-06 16:46 ` [PATCH] net: ch9200: use BIT macro for bitmask constants Andrew Lunn
2025-06-06 17:19 ` Qasim Ijaz
2025-06-06 19:00 ` Andrew Lunn
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=20250606160723.12679-1-qasdev00@gmail.com \
--to=qasdev00@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).