[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hGYV2PT_Ws-nF7zy1scmp=x5EMV-xvGzks=j4t=BhTBQ@mail.gmail.com>
Date: Mon, 28 Oct 2024 12:44:18 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Nam Cao <namcao@...utronix.de>
Cc: Anna-Maria Behnsen <anna-maria@...utronix.de>, Frederic Weisbecker <frederic@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Miguel Ojeda <ojeda@...nel.org>, Kees Cook <kees@...nel.org>,
linux-kernel@...r.kernel.org, "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH 15/44] powercap: Switch to use hrtimer_setup()
On Mon, Oct 28, 2024 at 8:35 AM Nam Cao <namcao@...utronix.de> wrote:
>
> There is a newly introduced hrtimer_setup() which will replace
> hrtimer_init(). This new function is similar to the old one, except that it
> also sanity-checks and initializes the timer's callback function.
>
> Switch to use this new function.
>
> Patch was created by using Coccinelle.
>
> Signed-off-by: Nam Cao <namcao@...utronix.de>
> ---
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Fine by me.
Acked-by: "Rafael J. Wysocki" <rafael@...nel.org>
> ---
> drivers/powercap/idle_inject.c | 3 +--
> drivers/powercap/intel_rapl_common.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_inject.c
> index bafc59904ed3..29f9f452d445 100644
> --- a/drivers/powercap/idle_inject.c
> +++ b/drivers/powercap/idle_inject.c
> @@ -339,8 +339,7 @@ struct idle_inject_device *idle_inject_register_full(struct cpumask *cpumask,
> return NULL;
>
> cpumask_copy(to_cpumask(ii_dev->cpumask), cpumask);
> - hrtimer_init(&ii_dev->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - ii_dev->timer.function = idle_inject_timer_fn;
> + hrtimer_setup(&ii_dev->timer, idle_inject_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> ii_dev->latency_us = UINT_MAX;
> ii_dev->update = update;
>
> diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
> index 5e793b80fd6b..e675d4240d9f 100644
> --- a/drivers/powercap/intel_rapl_common.c
> +++ b/drivers/powercap/intel_rapl_common.c
> @@ -2063,8 +2063,7 @@ int rapl_package_add_pmu(struct rapl_package *rp)
> raw_spin_lock_init(&data->lock);
> INIT_LIST_HEAD(&data->active_list);
> data->timer_interval = ms_to_ktime(rapl_pmu.timer_ms);
> - hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - data->hrtimer.function = rapl_hrtimer_handle;
> + hrtimer_setup(&data->hrtimer, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>
> return rapl_pmu_update(rp);
> }
> --
> 2.39.5
>
Powered by blists - more mailing lists