From nobody Thu Dec 18 03:58:43 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6447822DFA9 for ; Wed, 5 Feb 2025 10:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752424; cv=none; b=mNopP/yTFgjGOeeBm+VRrT3fQ99hF+tYiKB2qLOh/yBN/3+jtdLYurklDNKdvpGd+dXCIdVGPID8jr/0/POqHWZZcGch5ZKvASy0DYwBlEl5hZWwnBUq6E2PPxSQbFtCyhBkdcIjITYeIHOmDx9sAFbV38H6IDiPVBYcpq9eziU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752424; c=relaxed/simple; bh=6g/QPUlIJV8swSm7eBhrCXyD5X9cUmz6Kj0wDivSvC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cyuXRqIDoX7sqm90cSHh+or5QYxBBk2bX7fyREcWGAVATRXPe14N72XCOjK6JlwO28fiqHEXDvOEaWnKnssWOCLKRZR/kyJI5U0ms2fpCPT0MCRAOoDscfj1t5XHcuHHBuj7ZdJskGkONehkpDBKWLRvbxgKOcGxHScUERd5vYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=d71f1Ln2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fm9oQDJ3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="d71f1Ln2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fm9oQDJ3" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738752418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dv1Yu4iIeEMxKsUFYju9BcSqLadTHkwIowgqitCIxik=; b=d71f1Ln2mOnDn6Tgye60yVi0ljWznJqJ1cveAjbow+e0mfelBK/t4uWZPlZGCfSjV38VeK 5C47Qg3wbDmb6wNFScGmC7wvb+LZJqt8AfHQtcL8ExFdB12lb26GS4TcZf98rbjks8qAze EbKLrWrjy/ewxDcFpPuOnpQSMRLKhnl+/zP5ZkcGpa1dA05gyXT8o9gVd2JQV4FH4ZPVhK rJFj+UJTLy7epY5iRMKhgcBT4zffVVMYEiXB7vM8HiLmSsG9ypJAaXWYYJ69oYjfJbgrUj OuzTOunC/Kh76Nek4JUC5VqA62SKqnGEHKZ0wnj+pU0hH2k75sUWWriu4iebCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738752418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dv1Yu4iIeEMxKsUFYju9BcSqLadTHkwIowgqitCIxik=; b=fm9oQDJ3w4R7Ho1KWAMKePPgCgqK/5Xjtecsfl9uD0oBFlU7f1ttjYtdz3qRYk+4yv5QCF CddpQFJjDxYiMmAg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , "Rafael J . Wysocki" , Zack Rusin Subject: [PATCH v2 16/45] powercap: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:46:04 +0100 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Acked-by: Rafael J. Wysocki Acked-by: Zack Rusin Signed-off-by: Nam Cao --- 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 04c212953ded..5ad7cc438068 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(st= ruct cpumask *cpumask, return NULL; =20 cpumask_copy(to_cpumask(ii_dev->cpumask), cpumask); - hrtimer_init(&ii_dev->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - ii_dev->timer.function =3D idle_inject_timer_fn; + hrtimer_setup(&ii_dev->timer, idle_inject_timer_fn, CLOCK_MONOTONIC, HRTI= MER_MODE_REL); ii_dev->latency_us =3D UINT_MAX; ii_dev->update =3D update; =20 diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_= rapl_common.c index 77d75e1f14a9..cf3d806284c4 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -2064,8 +2064,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 =3D ms_to_ktime(rapl_pmu.timer_ms); - hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - data->hrtimer.function =3D rapl_hrtimer_handle; + hrtimer_setup(&data->hrtimer, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIM= ER_MODE_REL); =20 return rapl_pmu_update(rp); } --=20 2.39.5