public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Cc: Nam Cao <namcao@linutronix.de>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Neukum <oliver@neukum.org>, Kalle Valo <kvalo@kernel.org>
Subject: [PATCH v2 00/24] hrtimers: Consolidate hrtimer initialization - Part 3
Date: Wed,  5 Feb 2025 11:43:20 +0100	[thread overview]
Message-ID: <cover.1738746872.git.namcao@linutronix.de> (raw)

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


             reply	other threads:[~2025-02-05 10:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 10:43 Nam Cao [this message]
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

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=cover.1738746872.git.namcao@linutronix.de \
    --to=namcao@linutronix.de \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=oliver@neukum.org \
    --cc=pabeni@redhat.com \
    --cc=tglx@linutronix.de \
    /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