lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250827155455583-PdvmDYA9SD3J37_XRza5@zte.com.cn>
Date: Wed, 27 Aug 2025 15:54:55 +0800 (CST)
From: <zhang.enpei@....com.cn>
To: <chessman@....org>
Cc: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
        <kuba@...nel.org>, <pabeni@...hat.com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH v3] ethernet: tlan: Convert to use jiffies macro

From: Zhang Enpei <zhang.enpei@....com.cn>

Use time_is_before_eq_jiffies macro instead of using jiffies directly to
handle wraparound.

Signed-off-by: Zhang Enpei <zhang.enpei@....com.cn>
---
 drivers/net/ethernet/ti/tlan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index a55b0f951181..7c5e51284942 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -1817,7 +1817,6 @@ static void tlan_timer(struct timer_list *t)
 {
 	struct tlan_priv	*priv = timer_container_of(priv, t, timer);
 	struct net_device	*dev = priv->dev;
-	u32		elapsed;
 	unsigned long	flags = 0;

 	priv->timer.function = NULL;
@@ -1844,8 +1843,7 @@ static void tlan_timer(struct timer_list *t)
 	case TLAN_TIMER_ACTIVITY:
 		spin_lock_irqsave(&priv->lock, flags);
 		if (priv->timer.function == NULL) {
-			elapsed = jiffies - priv->timer_set_at;
-			if (elapsed >= TLAN_TIMER_ACT_DELAY) {
+			if (time_is_before_eq_jiffies(priv->timer_set_at + TLAN_TIMER_ACT_DELAY)) {
 				tlan_dio_write8(dev->base_addr,
 						TLAN_LED_REG, TLAN_LED_LINK);
 			} else  {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ