Skip to content

Commit f5aaaa6

Browse files
hayesorzdavem330
authored andcommitted
r8152: use BIT macro
Use BIT macro to replace (1 << bits). Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6e74d17 commit f5aaaa6

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

‎drivers/net/usb/r8152.c‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -489,16 +489,16 @@ struct rx_desc {
489489
#define RX_LEN_MASK 0x7fff
490490

491491
__le32 opts2;
492-
#define RD_UDP_CS (1 << 23)
493-
#define RD_TCP_CS (1 << 22)
494-
#define RD_IPV6_CS (1 << 20)
495-
#define RD_IPV4_CS (1 << 19)
492+
#define RD_UDP_CS BIT(23)
493+
#define RD_TCP_CS BIT(22)
494+
#define RD_IPV6_CS BIT(20)
495+
#define RD_IPV4_CS BIT(19)
496496

497497
__le32 opts3;
498-
#define IPF (1 << 23) /* IP checksum fail */
499-
#define UDPF (1 << 22) /* UDP checksum fail */
500-
#define TCPF (1 << 21) /* TCP checksum fail */
501-
#define RX_VLAN_TAG (1 << 16)
498+
#define IPF BIT(23) /* IP checksum fail */
499+
#define UDPF BIT(22) /* UDP checksum fail */
500+
#define TCPF BIT(21) /* TCP checksum fail */
501+
#define RX_VLAN_TAG BIT(16)
502502

503503
__le32 opts4;
504504
__le32 opts5;
@@ -507,24 +507,24 @@ struct rx_desc {
507507

508508
struct tx_desc {
509509
__le32 opts1;
510-
#define TX_FS (1 << 31) /* First segment of a packet */
511-
#define TX_LS (1 << 30) /* Final segment of a packet */
512-
#define GTSENDV4 (1 << 28)
513-
#define GTSENDV6 (1 << 27)
510+
#define TX_FS BIT(31) /* First segment of a packet */
511+
#define TX_LS BIT(30) /* Final segment of a packet */
512+
#define GTSENDV4 BIT(28)
513+
#define GTSENDV6 BIT(27)
514514
#define GTTCPHO_SHIFT 18
515515
#define GTTCPHO_MAX 0x7fU
516516
#define TX_LEN_MAX 0x3ffffU
517517

518518
__le32 opts2;
519-
#define UDP_CS (1 << 31) /* Calculate UDP/IP checksum */
520-
#define TCP_CS (1 << 30) /* Calculate TCP/IP checksum */
521-
#define IPV4_CS (1 << 29) /* Calculate IPv4 checksum */
522-
#define IPV6_CS (1 << 28) /* Calculate IPv6 checksum */
519+
#define UDP_CS BIT(31) /* Calculate UDP/IP checksum */
520+
#define TCP_CS BIT(30) /* Calculate TCP/IP checksum */
521+
#define IPV4_CS BIT(29) /* Calculate IPv4 checksum */
522+
#define IPV6_CS BIT(28) /* Calculate IPv6 checksum */
523523
#define MSS_SHIFT 17
524524
#define MSS_MAX 0x7ffU
525525
#define TCPHO_SHIFT 17
526526
#define TCPHO_MAX 0x7ffU
527-
#define TX_VLAN_TAG (1 << 16)
527+
#define TX_VLAN_TAG BIT(16)
528528
};
529529

530530
struct r8152;

0 commit comments

Comments
 (0)