Skip to contentSkip to conversation

can: fix initial calculation of total rx/tx rate in CAN statistics

PATCH New Oliver Hartkopp 1 participant 1 message Jul 6, 2016

Subsystems (2)
lore
Share & tools
lore

Oliver Hartkopp

author maintainer
#0 lore raw

PATCH 1/1 can: fix initial calculation of total rx/tx rate in CAN statistics

The total rx/tx rate (TXR and RXR) only start working after a statistic reset. This patch initializes the referenced timer value to provide proper values for the total rx/tx rate directly from the start.

---
 net/can/af_can.c | 1 +
 1 file changed, 1 insertion(+)
net/can/af_can.c +1 -0
index 1108079..1319ee8 100644
@@ -917,6 +917,7 @@ static __init int can_init(void)
 			setup_timer(&can_stattimer, can_stat_update, 0);
 			mod_timer(&can_stattimer, round_jiffies(jiffies + HZ));
 		}
+		can_stats.jiffies_init = jiffies;
 		can_init_proc();
 	}
 
Signature · 1 line
2.8.1