Skip to contentSkip to conversation

net/packet: Remove unused macro BLOCK_PRIV

PATCH Superseded Wang Hai 2 participants 3 messages Sep 4, 2020 – Sep 5, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 net/packet: Remove unused macro BLOCK_PRIV

BPDU_TYPE_TCN is never used after it was introduced. So better to remove it.

---
 net/packet/af_packet.c | 1 -
 1 file changed, 1 deletion(-)
net/packet/af_packet.c +0 -1
index da8254e680f9..c430672c6a67 100644
@@ -177,7 +177,6 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
 #define BLOCK_LEN(x)		((x)->hdr.bh1.blk_len)
 #define BLOCK_SNUM(x)		((x)->hdr.bh1.seq_num)
 #define BLOCK_O2PRIV(x)	((x)->offset_to_priv)
-#define BLOCK_PRIV(x)		((void *)((char *)(x) + BLOCK_O2PRIV(x)))
 
 struct packet_sock;
 static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 3 lines · Wang Hai

BPDU_TYPE_TCN is never used after it was introduced. So better to remove it.

This comment does not cover the patch contents. Otherwise the patch looks good to me.

Quoted 21 lines
---
 net/packet/af_packet.c | 1 -
 1 file changed, 1 deletion(-)
net/packet/af_packet.c +0 -2
index da8254e680f9..c430672c6a67 100644
@@ -177,7 +177,6 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
 #define BLOCK_LEN(x)           ((x)->hdr.bh1.blk_len)
 #define BLOCK_SNUM(x)          ((x)->hdr.bh1.seq_num)
 #define BLOCK_O2PRIV(x)        ((x)->offset_to_priv)
-#define BLOCK_PRIV(x)          ((void *)((char *)(x) + BLOCK_O2PRIV(x)))
 
 struct packet_sock;
 static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
--

2.17.1

#2 lore raw
Quoted 5 lines · Willem de Bruijn
Quoted 2 lines · Wang Hai

BPDU_TYPE_TCN is never used after it was introduced. So better to remove it.

This comment does not cover the patch contents. Otherwise the patch looks good to me.

Thanks for your review, I will revise this comment.

Quoted 23 lines
Quoted 19 lines
---
  net/packet/af_packet.c | 1 -
  1 file changed, 1 deletion(-)
net/packet/af_packet.c +0 -2
index da8254e680f9..c430672c6a67 100644
@@ -177,7 +177,6 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
  #define BLOCK_LEN(x)           ((x)->hdr.bh1.blk_len)
  #define BLOCK_SNUM(x)          ((x)->hdr.bh1.seq_num)
  #define BLOCK_O2PRIV(x)        ((x)->offset_to_priv)
-#define BLOCK_PRIV(x)          ((void *)((char *)(x) + BLOCK_O2PRIV(x)))
 
  struct packet_sock;
  static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
--
Quoted 2 lines

2.17.1

.