diff mbox series

[net-next] net/packet: Remove unused macro BLOCK_PRIV

Message ID 20200904130608.19869-1-wanghai38@huawei.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [net-next] net/packet: Remove unused macro BLOCK_PRIV | expand

Commit Message

Wang Hai Sept. 4, 2020, 1:06 p.m. UTC
BPDU_TYPE_TCN is never used after it was introduced.
So better to remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
 net/packet/af_packet.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Willem de Bruijn Sept. 4, 2020, 1:26 p.m. UTC | #1
On Fri, Sep 4, 2020 at 3:09 PM Wang Hai <wanghai38@huawei.com> wrote:
>
> 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.

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
>  net/packet/af_packet.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index da8254e680f9..c430672c6a67 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -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
>
Wang Hai Sept. 5, 2020, 3 a.m. UTC | #2
在 2020/9/4 21:26, Willem de Bruijn 写道:
> On Fri, Sep 4, 2020 at 3:09 PM Wang Hai <wanghai38@huawei.com> wrote:
>> 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.
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Wang Hai <wanghai38@huawei.com>
>> ---
>>   net/packet/af_packet.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>> index da8254e680f9..c430672c6a67 100644
>> --- a/net/packet/af_packet.c
>> +++ b/net/packet/af_packet.c
>> @@ -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
>>
> .
>
diff mbox series

Patch

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index da8254e680f9..c430672c6a67 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -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,