[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220224081259.729050a5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 24 Feb 2022 08:12:59 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: 吴俊文 <wudaemon@....com>
Cc: davem@...emloft.net, chenhao288@...ilicon.com, arnd@...db.de,
shenyang39@...wei.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ksz884x: use time_before in netdev_open for
compatibility
On Thu, 24 Feb 2022 22:16:28 +0800 (CST) 吴俊文 wrote:
> Hi ,Jakub .I have changed my patch as your advise as follows:
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index 7dc451f..443d7bc 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -5301,7 +5301,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) @@ -5492,7 +5491,7 @@ static int netdev_open(struct net_device *dev) int i; int p; int rc = 0; - + unsigned long next_jiffies=0 priv->multicast = 0; priv->promiscuous = 0; @@ -5506,7 +5505,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) + if (time_before(next_jiffies, jiffies)) next_jiffies = jiffies + HZ * 2; else next_jiffies += HZ * 1; @@ -6642,7 +6641,7 @@ static void mib_read_work(struct work_struct *work) struct ksz_port_mib *mib; int i; - next_jiffies = jiffies; + unsigned long next_jiffies = jiffies; for (i = 0; i < hw->mib_port_cnt; i++) { mib = &hw->port_mib[i];
>
> Do you have any other advise ?Thanks
Sorry your patch got scrambled into a single line and encoded with HTML.
Feel free to post it with git as [PATCH v2] and we'll take it from
there.
Powered by blists - more mailing lists