All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, zuoqilin <zuoqilin@yulong.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [net-next 05/21] can: proc: remove unnecessary variables
Date: Thu, 27 May 2021 10:45:16 +0200	[thread overview]
Message-ID: <20210527084532.1384031-6-mkl@pengutronix.de> (raw)
In-Reply-To: <20210527084532.1384031-1-mkl@pengutronix.de>

From: zuoqilin <zuoqilin@yulong.com>

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 | 6 +-----
 1 file changed, 1 insertion(+), 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)
-- 
2.30.2



  parent reply	other threads:[~2021-05-27  8:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  8:45 pull-request: can-next 2021-05-27 Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 01/21] dt-bindings: can: rcar_can: Convert to json-schema Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 02/21] dt-bindings: can: rcar_canfd: " Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 03/21] can: uapi: update CAN-FD frame description Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 04/21] can: uapi: introduce CANFD_FDF flag for mixed content in struct canfd_frame Marc Kleine-Budde
2021-05-27  8:45 ` Marc Kleine-Budde [this message]
2021-05-27  8:45 ` [net-next 06/21] can: isotp: change error format from decimal to symbolic error names Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 07/21] can: isotp: add symbolic error message to isotp_module_init() Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 08/21] can: isotp: Add error message if txqueuelen is too small Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 09/21] can: softing: Remove redundant variable ptr Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 10/21] can: hi311x: hi3110_can_probe(): silence clang warning Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 11/21] can: mcp251x: mcp251x_can_probe(): " Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 12/21] can: mcp251xfd: " Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 13/21] can: at91_can: " Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 14/21] can: kvaser_usb: Rename define USB_HYBRID_{,PRO_}CANLIN_PRODUCT_ID Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 15/21] can: kvaser_usb: Add new Kvaser hydra devices Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 16/21] can: c_can: remove unused variable struct c_can_priv::rxmasked Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 17/21] can: c_can: add ethtool support Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 18/21] can: m_can: use bits.h macros for all regmasks Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 19/21] can: m_can: clean up CCCR reg defs, order by revs Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 20/21] can: m_can: make TXESC, RXESC config more explicit Marc Kleine-Budde
2021-05-27  8:45 ` [net-next 21/21] can: m_can: fix whitespace in a few comments Marc Kleine-Budde
2021-05-27 21:50 ` pull-request: can-next 2021-05-27 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210527084532.1384031-6-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zuoqilin@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.