public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/24] hrtimers: Consolidate hrtimer initialization - Part 3
@ 2025-02-05 10:43 Nam Cao
  2025-02-05 10:43 ` [PATCH v2 01/24] netdev: Switch to use hrtimer_setup() Nam Cao
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: Nam Cao @ 2025-02-05 10:43 UTC (permalink / raw)
  To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
	linux-kernel
  Cc: Nam Cao, Jakub Kicinski, Paolo Abeni, Marc Kleine-Budde,
	Oliver Neukum, Kalle Valo

hrtimers is initialized with hrtimer_init(), and after that the timer's
callback function is setup separately. This separate initialization is
error prone and awkward to use.

hrtimer_setup() combines the initialization and is simpler to use.

Switch to use the new setup function. Most conversions were done with
Coccinelle, see the sematic patch below.

This series is intended to be applied to the tip tree.

v1 -> v2 https://lore.kernel.org/lkml/cover.1729865232.git.namcao@linutronix.de
  - rebase to v6.14-rc1
  - use the existing hrtimer_dummy_timeout() for rt2x00 driver and bcm driver
---
virtual patch
@@ expression timer, clock, mode, func; @@
- hrtimer_init(timer, clock, mode);
  ...
- timer->function = func;
+ hrtimer_setup(timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup(&timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init_on_stack(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup_on_stack(&timer, func, clock, mode);

@@ expression timer, clock, mode; @@
- hrtimer_init_sleeper_on_stack(timer, clock, mode);
+ hrtimer_setup_sleeper_on_stack(timer, clock, mode);

---
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: Kalle Valo <kvalo@kernel.org>
---
 drivers/net/can/m_can/m_can.c                 |  9 ++++---
 .../net/can/spi/mcp251xfd/mcp251xfd-ring.c    |  8 +++----
 drivers/net/ethernet/cortina/gemini.c         |  5 ++--
 drivers/net/ethernet/ec_bhf.c                 |  3 +--
 drivers/net/ethernet/freescale/fec_ptp.c      |  4 ++--
 drivers/net/ethernet/hisilicon/hip04_eth.c    |  4 +---
 drivers/net/ethernet/intel/igc/igc_main.c     |  4 ++--
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  5 ++--
 .../net/ethernet/marvell/octeontx2/af/ptp.c   |  3 +--
 .../ethernet/microchip/sparx5/sparx5_packet.c |  4 ++--
 .../ethernet/qualcomm/rmnet/rmnet_map_data.c  |  4 ++--
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  6 ++---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c      |  9 ++++---
 drivers/net/ethernet/ti/icssg/icssg_common.c  |  5 ++--
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  |  5 ++--
 drivers/net/ieee802154/at86rf230.c            |  4 ++--
 drivers/net/usb/cdc_ncm.c                     |  3 +--
 .../wireless/mediatek/mt76/mt76x02_usb_core.c |  4 ++--
 .../net/wireless/ralink/rt2x00/rt2x00dev.c    |  4 ++--
 drivers/net/wireless/virtual/mac80211_hwsim.c |  6 ++---
 drivers/net/wwan/iosm/iosm_ipc_imem.c         | 24 ++++++++-----------
 include/linux/hrtimer.h                       |  5 ++++
 kernel/time/hrtimer.c                         |  5 ----
 net/can/bcm.c                                 | 20 +++++++---------
 net/can/isotp.c                               | 10 ++++----
 net/can/j1939/bus.c                           |  4 ++--
 net/can/j1939/transport.c                     |  8 ++-----
 net/core/dev.c                                |  3 +--
 net/ipv4/tcp_timer.c                          | 10 ++++----
 net/mac802154/main.c                          |  4 ++--
 net/sched/act_gate.c                          |  3 +--
 net/sched/sch_api.c                           |  3 +--
 net/sched/sch_taprio.c                        |  6 ++---
 net/xfrm/xfrm_iptfs.c                         |  6 ++---
 net/xfrm/xfrm_state.c                         |  4 ++--
 35 files changed, 88 insertions(+), 126 deletions(-)

-- 
2.39.5


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

end of thread, other threads:[~2025-02-05 10:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05 10:43 [PATCH v2 00/24] hrtimers: Consolidate hrtimer initialization - Part 3 Nam Cao
2025-02-05 10:43 ` [PATCH v2 01/24] netdev: Switch to use hrtimer_setup() Nam Cao
2025-02-05 10:43 ` [PATCH v2 02/24] net/sched: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 03/24] mac802154: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 04/24] tcp: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 05/24] can: m_can: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 06/24] can: mcp251xfd: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 07/24] can: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 08/24] net: ethernet: ti: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 09/24] net: ethernet: cortina: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 10/24] net: ethernet: ec_bhf: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 11/24] net: ethernet: hisilicon: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 12/24] net: sparx5: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 13/24] net: ieee802154: at86rf230: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 14/24] net: mvpp2: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 15/24] net: qualcomm: rmnet: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 16/24] net: stmmac: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 17/24] net: fec: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 18/24] net: wwan: iosm: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 19/24] net/cdc_ncm: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 20/24] wifi: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 21/24] wifi: rt2x00: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 22/24] igc: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 23/24] octeontx2-pf: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 24/24] xfrm: " Nam Cao

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