]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: scan: Use max macro
authorYan Zhen <yanzhen@vivo.com>
Tue, 27 Aug 2024 10:30:12 +0000 (18:30 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 28 Aug 2024 10:39:59 +0000 (12:39 +0200)
When the original file is guaranteed to contain the minmax.h header
file and compile correctly, using the real macro is usually
more intuitive and readable.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Link: https://patch.msgid.link/20240827103012.3853588-1-yanzhen@vivo.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/scan.c

index 3b2bde6360bcb6a0d4e2e7db759de1d81748c4c8..14e18fd9e91915cdbc7349ec2e86dac03a4d91e4 100644 (file)
@@ -1013,10 +1013,8 @@ set_channel:
         */
        if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) ||
            !scan_req->n_ssids) {
-               *next_delay = msecs_to_jiffies(scan_req->duration) >
-                             IEEE80211_PASSIVE_CHANNEL_TIME ?
-                             msecs_to_jiffies(scan_req->duration) :
-                             IEEE80211_PASSIVE_CHANNEL_TIME;
+               *next_delay = max(msecs_to_jiffies(scan_req->duration),
+                                 IEEE80211_PASSIVE_CHANNEL_TIME);
                local->next_scan_state = SCAN_DECISION;
                if (scan_req->n_ssids)
                        set_bit(SCAN_BEACON_WAIT, &local->scanning);