Commit 24a774a4 authored by zuoqilin's avatar zuoqilin Committed by Marc Kleine-Budde

can: proc: remove unnecessary variables

There is no need to define the variable "rate" to receive, just return
directly.

Link: https://lore.kernel.org/r/20210514100806.792-1-zuoqilin1@163.comSigned-off-by: default avatarzuoqilin <zuoqilin@yulong.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 02546884
......@@ -99,8 +99,6 @@ static void can_init_stats(struct net *net)
static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
unsigned long count)
{
unsigned long rate;
if (oldjif == newjif)
return 0;
......@@ -111,9 +109,7 @@ static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
return 99999999;
}
rate = (count * HZ) / (newjif - oldjif);
return rate;
return (count * HZ) / (newjif - oldjif);
}
void can_stat_update(struct timer_list *t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment