Skip to content

Commit

Permalink
wifi: mwifiex: Convert to use jiffies macro
Browse files Browse the repository at this point in the history
Use time_after macro instead of using jiffies directly to handle wraparound.
Change the type to to unsigned long to avoid unnecessary casts.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240823070320.430753-1-chenyufan@vivo.com
  • Loading branch information
Chen Yufan authored and Kalle Valo committed Sep 3, 2024
1 parent 0c896ec commit 97b766f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/marvell/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ struct mwifiex_auto_tdls_peer {
u8 mac_addr[ETH_ALEN];
u8 tdls_status;
int rssi;
long rssi_jiffies;
unsigned long rssi_jiffies;
u8 failure_count;
u8 do_discover;
u8 do_setup;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/marvell/mwifiex/tdls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,8 +1439,8 @@ void mwifiex_check_auto_tdls(struct timer_list *t)

spin_lock_bh(&priv->auto_tdls_lock);
list_for_each_entry(tdls_peer, &priv->auto_tdls_list, list) {
if ((jiffies - tdls_peer->rssi_jiffies) >
(MWIFIEX_AUTO_TDLS_IDLE_TIME * HZ)) {
if (time_after(jiffies, tdls_peer->rssi_jiffies +
MWIFIEX_AUTO_TDLS_IDLE_TIME * HZ)) {
tdls_peer->rssi = 0;
tdls_peer->do_discover = true;
priv->check_tdls_tx = true;
Expand Down

0 comments on commit 97b766f

Please sign in to comment.