All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: <netdev@vger.kernel.org>
Cc: <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net-next v2 7/7] r8152: use BIT macro
Date: Fri, 6 Feb 2015 11:30:51 +0800	[thread overview]
Message-ID: <1394712342-15778-136-Taiwan-albertk@realtek.com> (raw)
In-Reply-To: <1394712342-15778-129-Taiwan-albertk@realtek.com>

Use BIT macro to replace (1 << bits).

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 24e6aef9..5980ac6 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -489,16 +489,16 @@ struct rx_desc {
 #define RX_LEN_MASK			0x7fff
 
 	__le32 opts2;
-#define RD_UDP_CS			(1 << 23)
-#define RD_TCP_CS			(1 << 22)
-#define RD_IPV6_CS			(1 << 20)
-#define RD_IPV4_CS			(1 << 19)
+#define RD_UDP_CS			BIT(23)
+#define RD_TCP_CS			BIT(22)
+#define RD_IPV6_CS			BIT(20)
+#define RD_IPV4_CS			BIT(19)
 
 	__le32 opts3;
-#define IPF				(1 << 23) /* IP checksum fail */
-#define UDPF				(1 << 22) /* UDP checksum fail */
-#define TCPF				(1 << 21) /* TCP checksum fail */
-#define RX_VLAN_TAG			(1 << 16)
+#define IPF				BIT(23) /* IP checksum fail */
+#define UDPF				BIT(22) /* UDP checksum fail */
+#define TCPF				BIT(21) /* TCP checksum fail */
+#define RX_VLAN_TAG			BIT(16)
 
 	__le32 opts4;
 	__le32 opts5;
@@ -507,24 +507,24 @@ struct rx_desc {
 
 struct tx_desc {
 	__le32 opts1;
-#define TX_FS			(1 << 31) /* First segment of a packet */
-#define TX_LS			(1 << 30) /* Final segment of a packet */
-#define GTSENDV4		(1 << 28)
-#define GTSENDV6		(1 << 27)
+#define TX_FS			BIT(31) /* First segment of a packet */
+#define TX_LS			BIT(30) /* Final segment of a packet */
+#define GTSENDV4		BIT(28)
+#define GTSENDV6		BIT(27)
 #define GTTCPHO_SHIFT		18
 #define GTTCPHO_MAX		0x7fU
 #define TX_LEN_MAX		0x3ffffU
 
 	__le32 opts2;
-#define UDP_CS			(1 << 31) /* Calculate UDP/IP checksum */
-#define TCP_CS			(1 << 30) /* Calculate TCP/IP checksum */
-#define IPV4_CS			(1 << 29) /* Calculate IPv4 checksum */
-#define IPV6_CS			(1 << 28) /* Calculate IPv6 checksum */
+#define UDP_CS			BIT(31) /* Calculate UDP/IP checksum */
+#define TCP_CS			BIT(30) /* Calculate TCP/IP checksum */
+#define IPV4_CS			BIT(29) /* Calculate IPv4 checksum */
+#define IPV6_CS			BIT(28) /* Calculate IPv6 checksum */
 #define MSS_SHIFT		17
 #define MSS_MAX			0x7ffU
 #define TCPHO_SHIFT		17
 #define TCPHO_MAX		0x7ffU
-#define TX_VLAN_TAG			(1 << 16)
+#define TX_VLAN_TAG		BIT(16)
 };
 
 struct r8152;
-- 
2.1.0


  parent reply	other threads:[~2015-02-06  3:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  7:13 [PATCH net-next 0/7] r8152: adjust the code Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 1/7] r8152: adjust rx_bottom Hayes Wang
2015-01-19  8:03   ` Scott Feldman
2015-01-19 21:13     ` David Miller
2015-01-19 21:13       ` David Miller
2015-01-20  2:48       ` Hayes Wang
2015-01-20  2:52         ` David Miller
2015-01-20  3:24           ` Hayes Wang
2015-01-25  6:43             ` David Miller
2015-01-26  7:14               ` Hayes Wang
2015-01-26  7:14                 ` Hayes Wang
2015-02-02  2:38                 ` Hayes Wang
2015-01-26  9:14         ` Scott Feldman
2015-01-26  9:14           ` Scott Feldman
2015-01-19  7:13 ` [PATCH net-next 2/7] r8152: adjust lpm timer Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 3/7] r8152: check linking status with netif_carrier_ok Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 4/7] r8152: check RTL8152_UNPLUG for rtl8152_close Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 5/7] r8152: adjust the link feed for hw_features Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 6/7] r8152: replace get_protocol with vlan_get_protocol Hayes Wang
2015-01-19  7:13 ` [PATCH net-next 7/7] r8152: use BIT macro Hayes Wang
2015-02-06  3:30 ` [PATCH net-next v2 0/7] r8152: adjust the code Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 1/7] r8152: adjust rx_bottom Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 2/7] r8152: adjust lpm timer Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 3/7] r8152: check linking status with netif_carrier_ok Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 4/7] r8152: check RTL8152_UNPLUG for rtl8152_close Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 5/7] r8152: adjust the line feed for hw_features Hayes Wang
2015-02-06  3:30   ` [PATCH net-next v2 6/7] r8152: replace get_protocol with vlan_get_protocol Hayes Wang
2015-02-06  3:30   ` Hayes Wang [this message]
2015-02-08  6:46   ` [PATCH net-next v2 0/7] r8152: adjust the code David Miller

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=1394712342-15778-136-Taiwan-albertk@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.