The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Chen Yufan <chenyufan@vivo.com>
Cc: Francesco Dolcini <francesco@dolcini.it>,
	Kalle Valo <kvalo@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	opensource.kernel@vivo.com
Subject: Re: [PATCH v2] wifi: mwifiex: Convert to use jiffies macro
Date: Thu, 22 Aug 2024 10:46:29 -0700	[thread overview]
Message-ID: <Zsd5ddqiIgxaEPKs@google.com> (raw)
In-Reply-To: <20240822102906.141488-1-chenyufan@vivo.com>

On Thu, Aug 22, 2024 at 06:29:04PM +0800, Chen Yufan wrote:
> Use time_after macro instead of using
> jiffies directly to handle wraparound.
> The modifications made compared to the previous version are as follows:
> 1. Added a typecast to unsigned long for rssi_jiffies
> to resolve the compilation error.

Can we just change the type in mwifiex_auto_tdls_peer::rssi_jiffies?
Fewer casts is generally better.

Brian

> 
> Signed-off-by: Chen Yufan <chenyufan@vivo.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/tdls.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c
> index 6c60621b6..e48e8affd 100644
> --- a/drivers/net/wireless/marvell/mwifiex/tdls.c
> +++ b/drivers/net/wireless/marvell/mwifiex/tdls.c
> @@ -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, (unsigned long)tdls_peer->rssi_jiffies +
> +					 MWIFIEX_AUTO_TDLS_IDLE_TIME * HZ)) {
>  			tdls_peer->rssi = 0;
>  			tdls_peer->do_discover = true;
>  			priv->check_tdls_tx = true;
> -- 
> 2.39.0
> 

      reply	other threads:[~2024-08-22 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 10:29 [PATCH v2] wifi: mwifiex: Convert to use jiffies macro Chen Yufan
2024-08-22 17:46 ` Brian Norris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zsd5ddqiIgxaEPKs@google.com \
    --to=briannorris@chromium.org \
    --cc=chenyufan@vivo.com \
    --cc=francesco@dolcini.it \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox