diff mbox

net/packet: remove dead code and unneeded variable from prb_setup_retire_blk_timer()

Message ID alpine.LNX.2.00.1111150105500.10159@swampdragon.chaosbits.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Juhl Nov. 15, 2011, 12:08 a.m. UTC
On Mon, 14 Nov 2011, David Miller wrote:

> From: Jesper Juhl <jj@chaosbits.net>
> Date: Tue, 15 Nov 2011 00:51:57 +0100 (CET)
> 
> > On Mon, 14 Nov 2011, David Miller wrote:
> > 
> >> From: Jesper Juhl <jj@chaosbits.net>
> >> Date: Tue, 15 Nov 2011 00:37:33 +0100 (CET)
> >> 
> >> > David: You may want to pass on this one. I obviously didn't think it 
> >> > through properly - sorry :-(
> >> 
> >> It's already in my tree and pushed out to kernel.org, what in the
> >> world do you think "applied" means?
> >> 
> > I'm sorry about that. I try to be careful with my patches, but sometimes 
> > mistakes slip through - I'm only human... I do my best, but I mess up 
> > sometimes and Ryan raised a good point that I had not considered when I 
> > prepared the patch - what would you have me do except reply to his mail as 
> > I did?
> 
> Send a patch to fix things back up.

Sure, I can do that. Please see below.

I'm sorry about thiss mess and the extra work it caused you - I'll be more 
careful in the future.


From: Jesper Juhl <jj@chaosbits.net>
Subject: [PATCH] Revert incorrect dead-code changes to prb_setup_retire_blk_timer

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 net/packet/af_packet.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ab10e84..82a6f34 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -516,11 +516,13 @@  static void prb_init_blk_timer(struct packet_sock *po,
 
 static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring)
 {
+	struct tpacket_kbdq_core *pkc;
+
 	if (tx_ring)
 		BUG();
 
-	prb_init_blk_timer(po, &po->rx_ring.prb_bdqc,
-			   prb_retire_rx_blk_timer_expired);
+	pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc;
+	prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired);
 }
 
 static int prb_calc_retire_blk_tmo(struct packet_sock *po,