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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Oct 2022 10:25:15 -0400
From:   drake@...ketalley.com
To:     Manish Chopra <manishc@...vell.com>, GR-Linux-NIC-Dev@...vell.com,
        Coiby Xu <coiby.xu@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        netdev@...r.kernel.org, linux-staging@...ts.linux.dev
Cc:     linux-kernel@...r.kernel.org, Drake Talley <drake@...ketalley.com>
Subject: [PATCH 2/3] staging: qlge: replace msleep with usleep_range

From: Drake Talley <drake@...ketalley.com>

Since msleep may delay for up to 20ms, usleep_range is recommended for
short durations in the docs linked in the below warning.  I set the
range to 1000-2000 based on looking at other usages of usleep_range.

Reported by checkpatch:

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst

Signed-off-by: Drake Talley <drake@...ketalley.com>
---
 drivers/staging/qlge/qlge_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 8c1fdd8ebba0..c8403dbb5bad 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -3890,7 +3890,7 @@ static int qlge_close(struct net_device *ndev)
 	 * (Rarely happens, but possible.)
 	 */
 	while (!test_bit(QL_ADAPTER_UP, &qdev->flags))
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	/* Make sure refill_work doesn't re-enable napi */
 	for (i = 0; i < qdev->rss_ring_count; i++)
-- 
2.34.1

Powered by blists - more mailing lists