diff mbox series

[net-next,v3] nfp: Convert timeouts to secs_to_jiffies()

Message ID 20241210-converge-secs-to-jiffies-v3-20-59479891e658@linux.microsoft.com (mailing list archive)
State Accepted
Commit f87e4f2434430b0f750fbdff4fd0601807571bb2
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v3] nfp: Convert timeouts to secs_to_jiffies() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 3 this patch: 3
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-12-11--15-00 (tests: 764)

Commit Message

Easwar Hariharan Dec. 10, 2024, 10:56 p.m. UTC
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies(). As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)

@@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)

Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
This patch is pulled out from v2 [1] of my series to convert users of
msecs_to_jiffies() that need seconds-denominated timeouts to the new
secs_to_jiffies() API in include/linux/jiffies.h to send with the
net-next prefix as suggested by Christophe Leroy.

It may be possible to use prefixes for some patches but not others with b4
(that I'm using to manage the series as a whole) but I didn't find such
in the help. v3 of the series addressing other review comments is here:
https://lore.kernel.org/r/20241210-converge-secs-to-jiffies-v3-0-ddfefd7e9f2a@linux.microsoft.com

[1]: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Louis Peens Dec. 11, 2024, 9:39 a.m. UTC | #1
On Tue, Dec 10, 2024 at 10:56:53PM +0000, Easwar Hariharan wrote:
> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
> secs_to_jiffies(). As the value here is a multiple of 1000, use
> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
> 
> This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
> the following Coccinelle rules:
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
> 
> @@ constant C; @@
> 
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)
> 
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> ---
> This patch is pulled out from v2 [1] of my series to convert users of
> msecs_to_jiffies() that need seconds-denominated timeouts to the new
> secs_to_jiffies() API in include/linux/jiffies.h to send with the
> net-next prefix as suggested by Christophe Leroy.
> 
> It may be possible to use prefixes for some patches but not others with b4
> (that I'm using to manage the series as a whole) but I didn't find such
> in the help. v3 of the series addressing other review comments is here:
> https://lore.kernel.org/r/20241210-converge-secs-to-jiffies-v3-0-ddfefd7e9f2a@linux.microsoft.com
> 
> [1]: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
> ---
>  drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> index 98e098c09c03..abba165738a3 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
> @@ -2779,7 +2779,7 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
>  		break;
>  	}
>  
> -	netdev->watchdog_timeo = msecs_to_jiffies(5 * 1000);
> +	netdev->watchdog_timeo = secs_to_jiffies(5);
>  
>  	/* MTU range: 68 - hw-specific max */
>  	netdev->min_mtu = ETH_MIN_MTU;
> -- 
> 2.43.0
> 
It's not super clear to me which patch is handled where and through which tree
at the moment, but looks like this is a network driver change scoped to the
netdev tree, so makes sense to me to add sign-off here. Thanks for applying
this to the nfp driver.

Reviewed-by: Louis Peens <louis.peens@corigine.com>
Easwar Hariharan Dec. 11, 2024, 6:10 p.m. UTC | #2
On 12/11/2024 1:39 AM, Louis Peens wrote:
> On Tue, Dec 10, 2024 at 10:56:53PM +0000, Easwar Hariharan wrote:
>> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
>> secs_to_jiffies(). As the value here is a multiple of 1000, use
>> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
>>
>> This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
>> the following Coccinelle rules:
>>
>> @@ constant C; @@
>>
>> - msecs_to_jiffies(C * 1000)
>> + secs_to_jiffies(C)
>>
>> @@ constant C; @@
>>
>> - msecs_to_jiffies(C * MSEC_PER_SEC)
>> + secs_to_jiffies(C)
>>
>> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
>> ---
>> This patch is pulled out from v2 [1] of my series to convert users of
>> msecs_to_jiffies() that need seconds-denominated timeouts to the new
>> secs_to_jiffies() API in include/linux/jiffies.h to send with the
>> net-next prefix as suggested by Christophe Leroy.
>>
>> It may be possible to use prefixes for some patches but not others with b4
>> (that I'm using to manage the series as a whole) but I didn't find such
>> in the help. v3 of the series addressing other review comments is here:
>> https://lore.kernel.org/r/20241210-converge-secs-to-jiffies-v3-0-ddfefd7e9f2a@linux.microsoft.com
>>
>> [1]: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
>> ---

<snip>

>> -- 
>> 2.43.0
>>
> It's not super clear to me which patch is handled where and through which tree
> at the moment, but looks like this is a network driver change scoped to the
> netdev tree, so makes sense to me to add sign-off here. Thanks for applying
> this to the nfp driver.
> 
> Reviewed-by: Louis Peens <louis.peens@corigine.com>

Thanks for the review! All netdev patches will be handled via the netdev
tree, separately from the series, per Jakub's request. There are patches
for gve and ath11k that will also be pulled out from the series and go
through netdev. I'll send a v4 series to netdev including your
Reviewed-by for this patch.

Thanks,
Easwar
Jakub Kicinski Dec. 12, 2024, 4:04 a.m. UTC | #3
On Wed, 11 Dec 2024 10:10:13 -0800 Easwar Hariharan wrote:
> I'll send a v4 series to netdev including your
> Reviewed-by for this patch.

No need to repost this patch. Tooling will pick up Louis' tag.
patchwork-bot+netdevbpf@kernel.org Dec. 12, 2024, 4:20 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 10 Dec 2024 22:56:53 +0000 you wrote:
> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
> secs_to_jiffies(). As the value here is a multiple of 1000, use
> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
> 
> This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
> the following Coccinelle rules:
> 
> [...]

Here is the summary with links:
  - [net-next,v3] nfp: Convert timeouts to secs_to_jiffies()
    https://git.kernel.org/netdev/net-next/c/f87e4f243443

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 98e098c09c03..abba165738a3 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2779,7 +2779,7 @@  static void nfp_net_netdev_init(struct nfp_net *nn)
 		break;
 	}
 
-	netdev->watchdog_timeo = msecs_to_jiffies(5 * 1000);
+	netdev->watchdog_timeo = secs_to_jiffies(5);
 
 	/* MTU range: 68 - hw-specific max */
 	netdev->min_mtu = ETH_MIN_MTU;