]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: convert timeouts to secs_to_jiffies()
authorEaswar Hariharan <eahariha@linux.microsoft.com>
Wed, 19 Feb 2025 20:32:40 +0000 (20:32 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 26 Feb 2025 14:44:37 +0000 (15:44 +0100)
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies().  As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@depends on patch@
expression E;
@@

-msecs_to_jiffies(E * 1000)
+secs_to_jiffies(E)

-msecs_to_jiffies(E * MSEC_PER_SEC)
+secs_to_jiffies(E)

Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Link: https://patch.msgid.link/20250219203240.141272-1-eahariha@linux.microsoft.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c

index cd2124329521005d7048b1e89dd824574007464f..1de25e9763cbb8d8d2917da33cbcf98c1285021b 100644 (file)
@@ -1365,7 +1365,7 @@ void cfg80211_bss_age(struct cfg80211_registered_device *rdev,
                       unsigned long age_secs)
 {
        struct cfg80211_internal_bss *bss;
-       unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC);
+       unsigned long age_jiffies = secs_to_jiffies(age_secs);
 
        spin_lock_bh(&rdev->bss_lock);
        list_for_each_entry(bss, &rdev->bss_list, list)