From nobody Tue Apr 7 12:20:31 2026 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DEDD230BEC for ; Wed, 25 Feb 2026 15:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772032901; cv=none; b=mpsY5lJj5qee/O/gQ0QMFFafK5JdFYrZTJVOB/i78gIgTqjf6outcME5U789F6zB1Kr3QYcMoDBgJyjdF7WmVpoP7h+Di1da3z7ODWZW+5BjvzQhPjM5KjqBiqBPpm/Q3iIvBG0SAwc4s9WBMV3DohtteskOEBqP52TP/FpaQeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772032901; c=relaxed/simple; bh=dPXZr126O9VVq7+LOxQBZGJLzXIee3GhAYTk2HaGg6E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GcuXz/+oeOcioQEK+lS7O5JyLXJNVwfLaugL/HKqVqwP5HEjmELN5O0NKpUizT/kL+3TJESK3s6QcpW0ViMFcSiV/lsUE0gf4JbXuHjrprAtSSVSPp0uJAHqvz4t1ZrPXDooI+1qwHsQWVD9MlkFVJnzLOFwheuYP8anh5iKDfc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d+g4WRvU; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d+g4WRvU" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-896f44dc48dso61986576d6.2 for ; Wed, 25 Feb 2026 07:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772032899; x=1772637699; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IRJfBpOFQOH6x1G3Wc7OwAAmra8ReB01ZBwywpZamOM=; b=d+g4WRvU0HY8pE20WuYI3pbCnQAWlQ8nj+eYfq/YufC/JH6rdHz80MbS6HN+X2c8Wt l5NqXV7i1GljuSy+RFK9hEMzhR+T5AMc1MoE3W3a0oBSV+WL+0nQsBJD6FbshAcAiqt7 5evniastlbVNt597F3MIEup9r6EQj1CccPOXWhZtYGKbcrLlWGGmHcwPD6te8vZR8n/4 11RvG2yQNyk+ieCrXB3HIfbJvlUvJIvge4oYXgvzDzUowZWTV89ofMupp7nUFT3y/s1a k/JidV5BfW+xFyXy3YFPL7xsyjvmZKY3KDqSTYvZv1S5et54BhWPTOOkHnOtN7LQJziZ gCtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772032899; x=1772637699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IRJfBpOFQOH6x1G3Wc7OwAAmra8ReB01ZBwywpZamOM=; b=AvxtYeDSj6+6jW6uBt9NqTeMsBRjI9jk58IjsWWKbyW0AJFsxmWeH1Ucp5tlzl4/4O hMGdy2EjIpimo12DVlCR5lEyoTTdPWXrnSQ0ooT60B27ZQLOiFykUrTBhJ8MRaQsyDd1 WyTdYWE+lE3JTjeQdhDJZg+fOBE76CsBQjI49s5jtVcAYs7p0ph6bYbjmoFJF833/FGf r51kM14e067mC2xNXKhzxSWwm2MqGKCgfWmu0ac4OmVfPDYeIgNADWDJTzmrGXxiv/TF XyU7nJpN3F98uuZPK1qV23yL2ldvTYVVyClVwT3Um3Cj+WpiKpvGbRDXocIDhgo4EbWV OVhg== X-Forwarded-Encrypted: i=1; AJvYcCXIDgFdVsJM07pwyq5h/kwzHJNDlHe3rE/WXHP/4LGje3d2uZCHhymCWUHAT/iTbbmGXOL1JjS4xw4bgAs=@vger.kernel.org X-Gm-Message-State: AOJu0YxelS0zZOoaOc3M1o/3FHWG471di4MRhPinbL4nnYqVqoY20oS/ F7je7s0Cm4tunvBVh/FAYXADla3b+GYUrXfW3S//ZAQmNB+pDguOUlvwr8hS6Q== X-Gm-Gg: ATEYQzyNpdV6oSU5PVcxSBN3XigoAIiDURjkWdd7py+edY54FpYWXWC6zXiUeS9eO8o MvihaoHXYqUnvgeV7npcVznE+k13onAoibOsPaK6doHrsJ5BKhLT5oQ4yG4mwbfJMU2HdJ2r6pU 3dNhSH7B/nWHjh+4ACjoaPLfV7biJUVYWnPcr5PgKkzPhJM8Wyrtg9xkeqqAdeP1CbL+xz+YeBr 9m9Nkgq/aOHp4+jlwFd36MK3Mr1FzcpeWY0T/3HNFPofmS6/OwnxNocTLX0P4FE87KMtHSO6qw7 N9FUgbuIWmN0YoWCxevzpbGjKS2OKRQ2cWneJMmtowetw8Hnj9UptbdLO7JF9u8hkn5vZWKgtXd ZITh9jNKD+eH8aAXjcVYfgCw3idtqNFpsejwPfUW3VPgCDK78W/AYukEwMzbCSz5BUPboiBC+4J 6ZcdtwSOaJxu6Mt/3YTJ5XezNyZzH+TQuHWsw34Ky1uS13GOdWm2wV X-Received: by 2002:a05:6214:2aa8:b0:882:52fc:9acc with SMTP id 6a1803df08f44-89979d66c29mr234957546d6.52.1772032899106; Wed, 25 Feb 2026 07:21:39 -0800 (PST) Received: from localhost.localdomain ([50.21.71.60]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8997c6993d3sm118579756d6.4.2026.02.25.07.21.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 25 Feb 2026 07:21:38 -0800 (PST) From: Neel Bullywon To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: andy@kernel.org, linux-kernel@vger.kernel.org, Neel Bullywon Subject: [PATCH v3] checkpatch: mention fsleep() in MSLEEP and USLEEP_RANGE warnings Date: Wed, 25 Feb 2026 10:21:35 -0500 Message-ID: <20260225152135.7709-1-neelb2403@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20260220230555.70073-1-neelb2403@gmail.com> References: <20260220230555.70073-1-neelb2403@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Expand the USLEEP_RANGE check to recommend fsleep() as the preferred option over both usleep_range() and udelay(), and expand the MSLEEP warning to suggest considering fsleep() for short msleep calls. fsleep() autoselects the best sleep mechanism based on duration, making it the preferred choice for sleep operations. Signed-off-by: Neel Bullywon Reviewed-by: Andy Shevchenko --- v3: - USLEEP_RANGE: reword to recommend fsleep() as preferred over others (Andy Shevchenko) - MSLEEP: add "consider using fsleep()" (Andy Shevchenko) v2: - Reworded to keep usleep_range as primary suggestion and add fsleep() as additional reference (Joe Perches) scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c0250244cf7a..fc08c780610a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6624,7 +6624,7 @@ sub process { # ignore udelay's < 10, however if (! ($delay < 10) ) { CHK("USLEEP_RANGE", - "usleep_range is preferred over udelay; see function description o= f usleep_range() and udelay().\n" . $herecurr); + "fsleep() is preferred over others; usleep_range() is preferred ov= er udelay(); see function descriptions of usleep_range(), udelay(), and fsl= eep().\n" . $herecurr); } if ($delay > 2000) { WARN("LONG_UDELAY", @@ -6636,7 +6636,7 @@ sub process { if ($line =3D~ /\bmsleep\s*\((\d+)\);/) { if ($1 < 20) { WARN("MSLEEP", - "msleep < 20ms can sleep for up to 20ms; see function description= of msleep().\n" . $herecurr); + "msleep < 20ms can sleep for up to 20ms; consider using fsleep();= see function description of msleep() and fsleep().\n" . $herecurr); } } =20 --=20 2.44.0