diff mbox series

[v4] net: ksz884x: optimize netdev_open flow and remove static variable

Message ID 20220313032748.3642-1-wudaemon@163.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [v4] net: ksz884x: optimize netdev_open flow and remove static variable | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 39 this patch: 39
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 37 this patch: 37
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 39 this patch: 39
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 37 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Junwen Wu March 13, 2022, 3:27 a.m. UTC
remove the static next_jiffies variable, and reinitialize next_jiffies to simplify netdev_open

Signed-off-by: wudaemon <wudaemon@163.com>
---
 drivers/net/ethernet/micrel/ksz884x.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Paolo Abeni March 15, 2022, 9:02 a.m. UTC | #1
Hello,

On Sun, 2022-03-13 at 03:27 +0000, wudaemon wrote:
> remove the static next_jiffies variable, and reinitialize next_jiffies to simplify netdev_open
> 
> Signed-off-by: wudaemon <wudaemon@163.com>

I'm sorry for tha late feedback, but the above looks like a pseudonyms,
which is explicitly not allowed by the process - see
Documentation/process/submitting-patches.rst.

If the above is guess is true, please respin the patch with your actual
name. While at it, please limit the commit message description at 75
chars and specify a target tree in the subj (net-next I guess?)

Thanks!

Paolo
diff mbox series

Patch

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index d024983815da..2b3eb5ed8233 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -5225,7 +5225,6 @@  static irqreturn_t netdev_intr(int irq, void *dev_id)
  * Linux network device functions
  */
 
-static unsigned long next_jiffies;
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void netdev_netpoll(struct net_device *dev)
@@ -5411,10 +5410,12 @@  static int netdev_open(struct net_device *dev)
 	struct dev_info *hw_priv = priv->adapter;
 	struct ksz_hw *hw = &hw_priv->hw;
 	struct ksz_port *port = &priv->port;
+	unsigned long next_jiffies;
 	int i;
 	int p;
 	int rc = 0;
 
+	next_jiffies = jiffies + HZ * 2;
 	priv->multicast = 0;
 	priv->promiscuous = 0;
 
@@ -5428,10 +5429,7 @@  static int netdev_open(struct net_device *dev)
 		if (rc)
 			return rc;
 		for (i = 0; i < hw->mib_port_cnt; i++) {
-			if (next_jiffies < jiffies)
-				next_jiffies = jiffies + HZ * 2;
-			else
-				next_jiffies += HZ * 1;
+			next_jiffies += HZ * 1;
 			hw_priv->counter[i].time = next_jiffies;
 			hw->port_mib[i].state = media_disconnected;
 			port_init_cnt(hw, i);
@@ -6563,6 +6561,7 @@  static void mib_read_work(struct work_struct *work)
 	struct dev_info *hw_priv =
 		container_of(work, struct dev_info, mib_read);
 	struct ksz_hw *hw = &hw_priv->hw;
+	unsigned long next_jiffies;
 	struct ksz_port_mib *mib;
 	int i;