Skip to content

Commit 31d5314

Browse files
committed
Revise the writing style of version check
Adopt Jserv's suggestion: When there are no newer versions in the program statement, the form "#if LINUX_VERSION_CODE < KERNEL_VERSION" can be used for writing.
1 parent d4e1fb7 commit 31d5314

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vwifi.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ static void inform_bss(struct vwifi_vif *vif)
454454
struct cfg80211_inform_bss data = {
455455
/* the only channel */
456456
.chan = &ap->wdev.wiphy->bands[NL80211_BAND_2GHZ]->channels[0],
457-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
458-
#else
457+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0)
459458
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
460459
#endif
461460
.signal = DBM_TO_MBM(rand_int_smooth(-100, -30, jiffies)),
@@ -532,8 +531,7 @@ static enum hrtimer_restart vwifi_beacon(struct hrtimer *timer)
532531
.boottime_ns = ktime_get_boottime_ns(),
533532
.chan = vif->channel,
534533
};
535-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
536-
#else
534+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0)
537535
switch (vif->bw) {
538536
case NL80211_CHAN_WIDTH_5:
539537
bss_meta.scan_width = NL80211_BSS_CHAN_WIDTH_5;
@@ -2567,8 +2565,7 @@ static void vwifi_virtio_mgmt_rx_scan_response(
25672565
};
25682566
struct cfg80211_inform_bss data = {
25692567
.chan = &rx_channel,
2570-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
2571-
#else
2568+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0)
25722569
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
25732570
#endif
25742571
.signal = DBM_TO_MBM(rand_int_smooth(-100, -30, jiffies)),

0 commit comments

Comments
 (0)