Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'converge-on-using-secs_to_jiffies-part-two'

Easwar Hariharan says:

====================
Converge on using secs_to_jiffies() part two

This is the second series (part 1*) that converts users of msecs_to_jiffies() that
either use the multiply pattern of either of:
- msecs_to_jiffies(N*1000) or
- msecs_to_jiffies(N*MSEC_PER_SEC)

where N is a constant or an expression, to avoid the multiplication.

The conversion is made with Coccinelle with the secs_to_jiffies() script
in scripts/coccinelle/misc. Attention is paid to what the best change
can be rather than restricting to what the tool provides.

v1: https://lore.kernel.org/20250219-netdev-secs-to-jiffies-part-2-v1-0-c484cc63611b@linux.microsoft.com
====================

Link: https://patch.msgid.link/20250707-netdev-secs-to-jiffies-part-2-v2-0-b7817036342f@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+4 -5
+3 -3
net/ipv4/ipconfig.c
··· 274 274 275 275 /* wait for a carrier on at least one device */ 276 276 start = jiffies; 277 - next_msg = start + msecs_to_jiffies(20000); 277 + next_msg = start + secs_to_jiffies(20); 278 278 while (time_before(jiffies, start + 279 - msecs_to_jiffies(carrier_timeout * 1000))) { 279 + secs_to_jiffies(carrier_timeout))) { 280 280 int wait, elapsed; 281 281 282 282 rtnl_lock(); ··· 295 295 elapsed = jiffies_to_msecs(jiffies - start); 296 296 wait = (carrier_timeout * 1000 - elapsed + 500) / 1000; 297 297 pr_info("Waiting up to %d more seconds for network.\n", wait); 298 - next_msg = jiffies + msecs_to_jiffies(20000); 298 + next_msg = jiffies + secs_to_jiffies(20); 299 299 } 300 300 have_carrier: 301 301
+1 -2
net/smc/af_smc.c
··· 2735 2735 2736 2736 if (lsmc->sockopt_defer_accept && !(arg->flags & O_NONBLOCK)) { 2737 2737 /* wait till data arrives on the socket */ 2738 - timeo = msecs_to_jiffies(lsmc->sockopt_defer_accept * 2739 - MSEC_PER_SEC); 2738 + timeo = secs_to_jiffies(lsmc->sockopt_defer_accept); 2740 2739 if (smc_sk(nsk)->use_fallback) { 2741 2740 struct sock *clcsk = smc_sk(nsk)->clcsock->sk; 2742 2741