projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0254688
)
can: proc: remove unnecessary variables
author
zuoqilin
<zuoqilin@yulong.com>
Fri, 14 May 2021 10:08:06 +0000
(18:08 +0800)
committer
Marc Kleine-Budde
<mkl@pengutronix.de>
Thu, 27 May 2021 07:42:21 +0000
(09:42 +0200)
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>
net/can/proc.c
patch
|
blob
|
history
diff --git
a/net/can/proc.c
b/net/can/proc.c
index d1fe49e6f16d7eb11776ab7c214fa3258fefd7d5..b3099f0a3cb824772e21f7c4bc0c2d1392669dee 100644
(file)
--- 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)