linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ch9200: use BIT macro for bitmask constants
@ 2025-06-06 16:07 Qasim Ijaz
  2025-06-06 16:46 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Qasim Ijaz @ 2025-06-06 16:07 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: linux-usb, netdev, linux-kernel

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-06 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 16:07 [PATCH] net: ch9200: use BIT macro for bitmask constants Qasim Ijaz
2025-06-06 16:46 ` Andrew Lunn
2025-06-06 17:19   ` Qasim Ijaz
2025-06-06 19:00     ` Andrew Lunn

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).