diff options
author | zuoqilin <zuoqilin@yulong.com> | 2021-05-14 18:08:06 +0800 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-05-27 09:42:21 +0200 |
commit | 24a774a4f9750ecd37d7aaeacfc04a844b9cf20b (patch) | |
tree | efe68736c7d63a4ec532fffa7215aaba116b50d6 /net/can | |
parent | 02546884221279da2725e87e35348290470363d7 (diff) |
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.com
Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/proc.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/can/proc.c b/net/can/proc.c index d1fe49e6f16d..b3099f0a3cb8 100644 --- a/net/can/proc.c +++ b/net/can/proc.c @@ -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) |