public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] wifi: mwifiex: Convert to use jiffies macro
@ 2024-08-23  7:03 Chen Yufan
  2024-08-23  7:43 ` Francesco Dolcini
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chen Yufan @ 2024-08-23  7:03 UTC (permalink / raw)
  To: Brian Norris, Francesco Dolcini, Kalle Valo, Stephen Rothwell,
	Chen Yufan, linux-wireless, linux-kernel
  Cc: opensource.kernel

Use time_after macro instead of using
jiffies directly to handle wraparound.
The modifications made compared to the previous version are as follows:
1. change the type of mwifiex_auto_tdls_peer::rssi_jiffies to
unsigned long.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
---
 drivers/net/wireless/marvell/mwifiex/main.h | 2 +-
 drivers/net/wireless/marvell/mwifiex/tdls.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
index 9024bb944..7398bacc1 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -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;
diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c
index 6c60621b6..7823e6769 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, 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] wifi: mwifiex: Convert to use jiffies macro
  2024-08-23  7:03 [PATCH v3] wifi: mwifiex: Convert to use jiffies macro Chen Yufan
@ 2024-08-23  7:43 ` Francesco Dolcini
  2024-08-23 17:01 ` Brian Norris
  2024-09-03 18:31 ` [v3] " Kalle Valo
  2 siblings, 0 replies; 6+ messages in thread
From: Francesco Dolcini @ 2024-08-23  7:43 UTC (permalink / raw)
  To: Chen Yufan, Brian Norris, Kalle Valo, Stephen Rothwell,
	linux-wireless, linux-kernel
  Cc: opensource.kernel

Hello Chen,
thanks for your patch


Il 23 agosto 2024 09:03:19 CEST, Chen Yufan <chenyufan@vivo.com> ha scritto:
>Use time_after macro instead of using
>jiffies directly to handle wraparound.
>The modifications made compared to the previous version are as follows:
>1. change the type of mwifiex_auto_tdls_peer::rssi_jiffies to
>unsigned long.

The patch changelog should not be part of the commit message, you should have it afterwards.

Francesco 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] wifi: mwifiex: Convert to use jiffies macro
  2024-08-23  7:03 [PATCH v3] wifi: mwifiex: Convert to use jiffies macro Chen Yufan
  2024-08-23  7:43 ` Francesco Dolcini
@ 2024-08-23 17:01 ` Brian Norris
  2024-08-26  3:18   ` 陈玉凡
  2024-09-03 18:31 ` [v3] " Kalle Valo
  2 siblings, 1 reply; 6+ messages in thread
From: Brian Norris @ 2024-08-23 17:01 UTC (permalink / raw)
  To: Chen Yufan
  Cc: Francesco Dolcini, Kalle Valo, Stephen Rothwell, linux-wireless,
	linux-kernel, opensource.kernel

On Fri, Aug 23, 2024 at 03:03:19PM +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. change the type of mwifiex_auto_tdls_peer::rssi_jiffies to
> unsigned long.
> 
> Signed-off-by: Chen Yufan <chenyufan@vivo.com>

Changelog questions aside, this looks fine to me:

Acked-by: Brian Norris <briannorris@chromium.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] wifi: mwifiex: Convert to use jiffies macro
  2024-08-23 17:01 ` Brian Norris
@ 2024-08-26  3:18   ` 陈玉凡
  2024-08-26  6:40     ` Francesco Dolcini
  0 siblings, 1 reply; 6+ messages in thread
From: 陈玉凡 @ 2024-08-26  3:18 UTC (permalink / raw)
  To: Brian Norris, 陈玉凡
  Cc: Francesco Dolcini, Kalle Valo, Stephen Rothwell,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	opensource.kernel

在 2024/8/24 1:01, Brian Norris 写道:
> On Fri, Aug 23, 2024 at 03:03:19PM +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. change the type of mwifiex_auto_tdls_peer::rssi_jiffies to
>> unsigned long.
>>
>> Signed-off-by: Chen Yufan <chenyufan@vivo.com>
> Changelog questions aside, this looks fine to me:
>
> Acked-by: Brian Norris <briannorris@chromium.org>

Thanks, I will pay attention to this question next time.

-Chen



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] wifi: mwifiex: Convert to use jiffies macro
  2024-08-26  3:18   ` 陈玉凡
@ 2024-08-26  6:40     ` Francesco Dolcini
  0 siblings, 0 replies; 6+ messages in thread
From: Francesco Dolcini @ 2024-08-26  6:40 UTC (permalink / raw)
  To: 陈玉凡
  Cc: Brian Norris, Francesco Dolcini, Kalle Valo, Stephen Rothwell,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	opensource.kernel

On Mon, Aug 26, 2024 at 03:18:28AM +0000, 陈玉凡 wrote:
> 在 2024/8/24 1:01, Brian Norris 写道:
> > On Fri, Aug 23, 2024 at 03:03:19PM +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. change the type of mwifiex_auto_tdls_peer::rssi_jiffies to
> >> unsigned long.
> >>
> >> Signed-off-by: Chen Yufan <chenyufan@vivo.com>
> > Changelog questions aside, this looks fine to me:
> >
> > Acked-by: Brian Norris <briannorris@chromium.org>
> 
> Thanks, I will pay attention to this question next time.

You should just send a v4 with this addressed and add the acked-by from Brian
while doing it.

Francesco


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v3] wifi: mwifiex: Convert to use jiffies macro
  2024-08-23  7:03 [PATCH v3] wifi: mwifiex: Convert to use jiffies macro Chen Yufan
  2024-08-23  7:43 ` Francesco Dolcini
  2024-08-23 17:01 ` Brian Norris
@ 2024-09-03 18:31 ` Kalle Valo
  2 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2024-09-03 18:31 UTC (permalink / raw)
  To: Chen Yufan
  Cc: Brian Norris, Francesco Dolcini, Stephen Rothwell, Chen Yufan,
	linux-wireless, linux-kernel, opensource.kernel

Chen Yufan <chenyufan@vivo.com> wrote:

> 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>

Patch applied to wireless-next.git, thanks.

97b766f989bc wifi: mwifiex: Convert to use jiffies macro

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240823070320.430753-1-chenyufan@vivo.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
https://docs.kernel.org/process/submitting-patches.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-03 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23  7:03 [PATCH v3] wifi: mwifiex: Convert to use jiffies macro Chen Yufan
2024-08-23  7:43 ` Francesco Dolcini
2024-08-23 17:01 ` Brian Norris
2024-08-26  3:18   ` 陈玉凡
2024-08-26  6:40     ` Francesco Dolcini
2024-09-03 18:31 ` [v3] " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox