af_packet: remove a stray tab in packet_set_ring()
Subsystems (4)
PATCH 1/1 af_packet: remove a stray tab in packet_set_ring()
At first glance it looks like there is a missing curly brace but actually the code works the same either way. I have adjusted the indenting but left the code the same.
net/packet/af_packet.c +1 -1
@@ -3786,7 +3786,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,*/ if (!tx_ring)init_prb_bdqc (po, rb, pg_vec, req_u, tx_ring); -break ; +break ;default :break ; }
Quoted 5 lines · Dan Carpenter
At first glance it looks like there is a missing curly brace but actually the code works the same either way. I have adjusted the indenting but left the code the same.
Signed-off-by Dan Carpenter <[email protected]>
Agreed.
Actually, this whole construct could have been simplified ...
switch (po->tp_version) {
case TPACKET_V3:
/* Transmit path is not supported. We checked
* it above but just being paranoid
*/
if (!tx_ring)
init_prb_bdqc(po, rb, pg_vec, req_u, tx_ring);
break;
default:
break;
}... into just one if condition. Looks a bit unnecessary as there's just one case. Feel free to change that as well.
Otherwise ...
Quoted 14 lines
net/packet/af_packet.c +1
-1@@ -3786,7 +3786,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,*/ if (!tx_ring)init_prb_bdqc (po, rb, pg_vec, req_u, tx_ring); -break ; +break ;default :break ; }
From: Dan Carpenter <[email protected]>
Date: Tue, 18 Feb 2014 15:20:51 +0300
Quoted 5 lines
At first glance it looks like there is a missing curly brace but actually the code works the same either way. I have adjusted the indenting but left the code the same.
Signed-off-by Dan Carpenter <[email protected]>
Applied, thank you.