From nobody Sun Dec 14 21:31:08 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 2ADA222B5B2 for ; Wed, 5 Feb 2025 10:39:48 +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=1738751990; cv=none; b=tZXhGHOne5whnh1BcpFaQt0urK7F6YBG6HVl3JAbzFK+vDcsJD3vQaFjJMtel2hW7uIdPjCJ/8k1vM2U6+uHTsPfbev3/A8cm3YCImCEGq3ZwMJFgYV5BNm1BfeLVwLZMijkqEgNyrfyyuk9s+03RwywAKumRJGqP/Re8GFi2Cs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751990; c=relaxed/simple; bh=PI6SlgGHXumEGQioc2qYh37cEpy3enZH8/Xqp8isHN0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hr7SWbKVklkm/LVXjwkzVQ4tTYx+Jzq9M2vUUe7DcoqVT0qzXLv5FxeIhW43IMVEnb+YZCiecmmFHZEkPJxdmIOkeS8GaNv7CqcOfrblZpnjg1RIZTPALrKFjfNoyG8ELZZxeGaUiIhZQmcnVKdbDUBZBpZc206orolIstx/8EA= 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=IrFIuli7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8JBr2HBp; 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="IrFIuli7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8JBr2HBp" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751987; 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=fZNTRP4aCpWMyie9jqscX4bbK//gd9aCHPJa4jd+gz0=; b=IrFIuli7jJ6jOIaYbf9StyM+k+8GW4BlJvS/CCAl/iMzRGCSUq6q+N8TsyIbvynu0VSOR5 m7bbkbPC6t9i2i9thwoAJ5oGDlKKiMlPWvVCUZ14KaMfB177YrNhLS+bQhK1PTULBPiqww 6ZhtV2xLYYFJELKSBtg42Vp3iGYHnVVPNzNsUJfeZRUe/aRYFdYB5U7Ntt6cL+MicfZ6us avd0dSFrufBhwXvCCdGgfsgYkgzjR/qXK1hIYf27QZWg0XUKnF6BtvJfUmujk+I4tmXF89 HUVL82mHPiTsPa0Zwhc6lqP6lBL6Jof2jdNsMNsaRO4EC5LHnYN4IIN32i5ZTA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751987; 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=fZNTRP4aCpWMyie9jqscX4bbK//gd9aCHPJa4jd+gz0=; b=8JBr2HBpWwDNGIcJJPzgCcVzfCkR5XfibwEE3BkEYWD0ZGHQI2wZJ9CSkjk+l+wvluQcz+ H1RCof6ob9aP9vBQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Thomas Bogendoerfer Subject: [PATCH v2 01/31] KVM: MIPS: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:45 +0100 Message-Id: <34004267eba24388fb50ef6de1b8dd7addba6475.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Thomas Bogendoerfer --- arch/mips/kvm/mips.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index 60b43ea85c12..cef3c423a41a 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -288,9 +288,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) if (err) return err; =20 - hrtimer_init(&vcpu->arch.comparecount_timer, CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - vcpu->arch.comparecount_timer.function =3D kvm_mips_comparecount_wakeup; + hrtimer_setup(&vcpu->arch.comparecount_timer, kvm_mips_comparecount_wakeu= p, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); =20 /* * Allocate space for host mode exception handlers that handle --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 2AD39217664 for ; Wed, 5 Feb 2025 10:39:48 +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=1738751991; cv=none; b=LFv/RAsXmrs+9McjTBRxNH482MPlNxue+aaIZxOs4Ab5y8T/0m9wS+wlxBCLLHiLQVurDAXLuZbrw9LMLbbTtjaswDqQYMQkxntb6VjFJaA5DHxXZSmThh/MZv9DH1eZlUTHRhM4NkIUYpB9XZTOa5Qdd9FP5+c3IQR5DAvQoEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751991; c=relaxed/simple; bh=0AlWFP+L6K9qFIBSCkQqCidKBd0B2mYor6Zzb97lT9I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=i/Ab9vHSfnpeA/Mg7mt0zQ5OZdqPvFMtNOp1yr5MpTHccZ0WJb5eUc3PKzFAjgxOZlzwSjuV6j7aJSSVHqSJRy2hswyfrw23z7OsHTJHMYPFFoC27sdFSkHUDH//Td6V9u0WsELsv/ayvm3n8W7qf9yCbTIuFBlvituy4B+Z9Do= 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=dWvggchz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6JZrjuZw; 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="dWvggchz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6JZrjuZw" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751987; 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=A+ndonM9L8AOxEJ72Lht6K6TGb2Ee1D0iIWQ1eJaHvY=; b=dWvggchzxN1++UwiCAQx/eoqKi38f8Bs0YZw2mM/a3+0D15vpiD49iWF+PiE38YeyU9CLn 0Diaf/bhJK97jCRXZ1PSnjsJ8h0oUuEnt6D4iFrxtdHbbgUCevzrxGaUA2W92KMQJjMQSU OebF2+mmY9Uxn/3XT4mBuYsi15sBfmF5g2kiq20cbNrob7akz7ci/9PlchUScbAjH49NXM Yq7kEKlhiXRPv+mGW3broypCgxAZbkglhF3gEGyDBtOTnvr5WGIHujMTczqOWIkiv8nP05 PDhWSgDOgCOJK1khZ+CcoeJ8ye2gWs4VYDuRDEXL/yH92VWJq64+nKo6rJ0hgg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751987; 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=A+ndonM9L8AOxEJ72Lht6K6TGb2Ee1D0iIWQ1eJaHvY=; b=6JZrjuZwl6t1w4coKqVRAtTjelBHxVPgNZSDvFLQzMPKvMvYj9gsRGVrNsSAyHZvfrDInX NC3/YcNUlNzSaKAw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Michael Ellerman Subject: [PATCH v2 02/31] KVM: PPC: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:46 +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. Signed-off-by: Nam Cao Cc: Michael Ellerman --- arch/powerpc/kvm/powerpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index ce1d91eed231..61f2b7e007fa 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -766,8 +766,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) { int err; =20 - hrtimer_init(&vcpu->arch.dec_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); - vcpu->arch.dec_timer.function =3D kvmppc_decrementer_wakeup; + hrtimer_setup(&vcpu->arch.dec_timer, kvmppc_decrementer_wakeup, CLOCK_REA= LTIME, + HRTIMER_MODE_ABS); =20 #ifdef CONFIG_KVM_EXIT_TIMING mutex_init(&vcpu->arch.exit_timing_lock); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 70D2A22ACD6 for ; Wed, 5 Feb 2025 10:39:49 +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=1738751992; cv=none; b=tp8M+o92AjuZuau0rFBwUvVum9Rp43cE5K5MT/yIRK//ZH1MIZnxRsitCblWr1UFwZFQTRbU2FwAYEKuvEteR0uiB0uU9MJ2ZMmBiLDGVBAU5dqNmVu6Zbp8FlFdnpqTQiXPCr/48NWOkV57BCMwLN8rbANaP/nlsoC2+aYZEp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751992; c=relaxed/simple; bh=sCZ6I4Qi6WTLwAq9rmMOuKNKx7qQHIUNw2SqagyKnJo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=re76FhwmgFQ8l1DGN7HdN52ks29s0xpwtdRkI717i3GQzG94GXyere2uxwYRxaHxT96q92qTnuRAdfx4nXUb4RqCs/dr9zhH/nGqMBqt5jQ83iEhHygrJklHqv+SeCLOYbXIAmsKPs2C9UT6GSqHC4K21uUfmKgklmWG6U0OqEk= 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=cNGxS1k1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZkxQvHMs; 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="cNGxS1k1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZkxQvHMs" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751987; 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=Bh36yyrgh2CvM85DSHJ1cdFb/MUta87+n929i888dTw=; b=cNGxS1k1DrhblODHunFopuW5qbx2jSAs+9ZA9YK8UtS57SJjWn2n3+3/y5/YJiaFLgZfm2 e9zNMClwyM5pN+Z97vW2QxGQ8+nJsQUGH3CXBeCJwdrYDQyuZZHbCRQJWyTJnMX4Z62CJ5 NaRTMy3dZfsfgckskFa9OnYbOUgRHsUv7jlhRQh2wOvdo0ZjnLy2/dXdZdKeN8jXYWow1C S6LHiHXgSco4gPImGVryANGBtKOlzt2Y1bqYDvTmnzk0rQr0meH+zQRx02hfqQodJob4j7 sn3+HiowMc4foKzjde6dxhyZgXHPZhsD6dBhpjzF8ZvMcEvCRnHaNaehjkB6iQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751987; 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=Bh36yyrgh2CvM85DSHJ1cdFb/MUta87+n929i888dTw=; b=ZkxQvHMsw+qHvLNKUx/kn9HeMsOcrGJpvbyXdZOQlPoipBnmRQWRoErT1wQTlT0khDEvsL DwOIAHkm/mVatSCA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Christian Borntraeger Subject: [PATCH v2 03/31] KVM: s390: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:47 +0100 Message-Id: <637865c62963fb8cddf6c4368ca12434988a8c27.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Christian Borntraeger Acked-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 3 +-- arch/s390/kvm/kvm-s390.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index d4f031e086fc..11a33fa21dfd 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -3171,8 +3171,7 @@ void kvm_s390_gisa_init(struct kvm *kvm) gi->alert.mask =3D 0; spin_lock_init(&gi->alert.ref_lock); gi->expires =3D 50 * 1000; /* 50 usec */ - hrtimer_init(&gi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - gi->timer.function =3D gisa_vcpu_kicker; + hrtimer_setup(&gi->timer, gisa_vcpu_kicker, CLOCK_MONOTONIC, HRTIMER_MODE= _REL); memset(gi->origin, 0, sizeof(struct kvm_s390_gisa)); gi->origin->next_alert =3D (u32)virt_to_phys(gi->origin); VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin); diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index d8080c27d45b..a0ef902c7a3d 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -3930,8 +3930,8 @@ static int kvm_s390_vcpu_setup(struct kvm_vcpu *vcpu) if (rc) return rc; } - hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - vcpu->arch.ckc_timer.function =3D kvm_s390_idle_wakeup; + hrtimer_setup(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, CLOCK_MONOTONI= C, + HRTIMER_MODE_REL); =20 vcpu->arch.sie_block->hpid =3D HPID_KVM; =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 C7D7222B5B6 for ; Wed, 5 Feb 2025 10:39:49 +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=1738751991; cv=none; b=k5ovDmvltiQ2m7dE9mG0nLJDxbkUBGjXpfwapEL3IIrJFHZfh/GjnTspFZeAKl8pqc4Nkm2oByujl6/AVfQKUFawHhhzZcyRa9n/0AayIRqNvayll9mJ78DoS/0d/HiRnisW0GmErhnmj0Uhrh2E/hotkPrA66CJV7nwkC5/qnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751991; c=relaxed/simple; bh=3SYRiNPmD3AWAyLMn2jU8DUNoACNnbgUi7Du+dwGfLA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jDFwC43tLqVkabMtd0Mncj2ISA0uHeMab32oK5eHPYKOwR6vi87n8rbOq36PI7iCYv/2EJZkmHvwpKvKyPLBGHuseTdTPgJVcOPXh+R+KjvLkemyMu8zXEieLk4EgZR27w+iGzf61gxjYeBdm7CsK21wJwifZeOMdex+CsertDQ= 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=WH3u3XQY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jfCkVTIN; 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="WH3u3XQY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jfCkVTIN" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751988; 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=e6aA5E3hNvEyqXjv+c2XoHGMcpM8KXV2NF/MaI1lk+8=; b=WH3u3XQYKplN1FC9PWlcgaIxAY1+ZlWFCHai++z9WVsiQg8QUZa9QmWeojMiM04IKKi4VC Z7v4pF9YXxnqwBbZcPxOTiZqI6ZYLEYfNTman5vekAgzo3qpNdc7AvUjIVLdPWYnzMrq0f mYcGe/TvDdcCwXT/XnyEAu57k28gJ+6AANMVNG+8nRBwxP9/4rkwsuMsI0lYjsdKu7YYFV e9Vc2mcofKZXNubL8DvAeLqw1NYm6V482pvm5/H7afVfhV90PUVn4XnXnCNovfbJFaC/WZ 38HC7eEbyqmh/zFPOgNUs0DSntuSw6UPV7kjM3k18tL2IVP4ToITcBcpqgjI7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751988; 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=e6aA5E3hNvEyqXjv+c2XoHGMcpM8KXV2NF/MaI1lk+8=; b=jfCkVTINVATvzz1JI9+icuzPcCoQXAnOog1NdyvYreH3evyrbVzH/rKUYF0ETF1I0w7POt w/IeIxciL/FR6vDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Sean Christopherson Subject: [PATCH v2 04/31] KVM: x86: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:48 +0100 Message-Id: <5051cfe7ed48ef9913bf2583eeca6795cb53d6ae.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Sean Christopherson Acked-by: Sean Christopherson --- arch/x86/kvm/hyperv.c | 3 +-- arch/x86/kvm/i8254.c | 3 +-- arch/x86/kvm/lapic.c | 5 ++--- arch/x86/kvm/vmx/nested.c | 5 ++--- arch/x86/kvm/xen.c | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 6a6dd5a84f22..eb9bca66bad0 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -952,8 +952,7 @@ static void stimer_init(struct kvm_vcpu_hv_stimer *stim= er, int timer_index) { memset(stimer, 0, sizeof(*stimer)); stimer->index =3D timer_index; - hrtimer_init(&stimer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - stimer->timer.function =3D stimer_timer_callback; + hrtimer_setup(&stimer->timer, stimer_timer_callback, CLOCK_MONOTONIC, HRT= IMER_MODE_ABS); stimer_prepare_msg(stimer); } =20 diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index d7ab8780ab9e..739aa6c0d0c3 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -690,8 +690,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 fla= gs) pit->kvm =3D kvm; =20 pit_state =3D &pit->pit_state; - hrtimer_init(&pit_state->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - pit_state->timer.function =3D pit_timer_fn; + hrtimer_setup(&pit_state->timer, pit_timer_fn, CLOCK_MONOTONIC, HRTIMER_M= ODE_ABS); =20 pit_state->irq_ack_notifier.gsi =3D 0; pit_state->irq_ack_notifier.irq_acked =3D kvm_pit_ack_irq; diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index a009c94c26c2..eb56cd989574 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -2921,9 +2921,8 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) =20 apic->nr_lvt_entries =3D kvm_apic_calc_nr_lvt_entries(vcpu); =20 - hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, - HRTIMER_MODE_ABS_HARD); - apic->lapic_timer.timer.function =3D apic_timer_fn; + hrtimer_setup(&apic->lapic_timer.timer, apic_timer_fn, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_HARD); if (lapic_timer_advance) apic->lapic_timer.timer_advance_ns =3D LAPIC_TIMER_ADVANCE_NS_INIT; =20 diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 8a7af02d466e..ca18c3eec76d 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5316,9 +5316,8 @@ static int enter_vmx_operation(struct kvm_vcpu *vcpu) if (enable_shadow_vmcs && !alloc_shadow_vmcs(vcpu)) goto out_shadow_vmcs; =20 - hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, - HRTIMER_MODE_ABS_PINNED); - vmx->nested.preemption_timer.function =3D vmx_preemption_timer_fn; + hrtimer_setup(&vmx->nested.preemption_timer, vmx_preemption_timer_fn, CLO= CK_MONOTONIC, + HRTIMER_MODE_ABS_PINNED); =20 vmx->nested.vpid02 =3D allocate_vpid(); =20 diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index a909b817b9c0..1ac738dcf7a2 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -2225,8 +2225,8 @@ void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu) vcpu->arch.xen.poll_evtchn =3D 0; =20 timer_setup(&vcpu->arch.xen.poll_timer, cancel_evtchn_poll, 0); - hrtimer_init(&vcpu->arch.xen.timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HAR= D); - vcpu->arch.xen.timer.function =3D xen_timer_callback; + hrtimer_setup(&vcpu->arch.xen.timer, xen_timer_callback, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_HARD); =20 kvm_gpc_init(&vcpu->arch.xen.runstate_cache, vcpu->kvm); kvm_gpc_init(&vcpu->arch.xen.runstate2_cache, vcpu->kvm); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 EA2AB22B5B7 for ; Wed, 5 Feb 2025 10:39:49 +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=1738751991; cv=none; b=tsDtygp7I/RrSGiZnKPo8lKV5OZOAFjkBwcDj2FHqbd4Q1HmcxWdOJG4ywDwuV3nBNGSsq5HM7Pd14AaAqJ7OfOww1kYbAoLMTPXWvN7zAM1cMF3N08Wie8ui+9BiO02oO40sLk20/Fy5//qdPLoMD4snhFphl65EwQJPPXGqCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751991; c=relaxed/simple; bh=lkioxytLyLOzlOCjq4kLo9WqwgcRQ4LKdz7AwPmGvks=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QxB2cWmdCMqNbksDdczS8fRKUfmS3RX39/Wv430TTq/nQcvuHm8QVMs5Hg0UjjV7SBwlTQNdT2q8yFV+EFNLZ9nN+35wyEk1F5dHSnqtzxoby0Q9OHP90LD5xRYl6s+L6i3yD/dpwzYtb7t0PLWb5kPNC3PiNAwKPuCy6su2enI= 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=EZIf0rR5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Oyk2ReUq; 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="EZIf0rR5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Oyk2ReUq" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751988; 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=RC09dGl/tBzE6mq76ewmtaQViiiepnE+GfeDm6vi4MA=; b=EZIf0rR5GQRc3vs5DtYzAk+OMzsHVTsSFW34m2BZAp4igw5qgT6we4toMefjkUBmFmy4f5 A56WN+O92BkDG9YcaLOGNLDxwwmvPEJms7w+d1LvPgPCAVv/sz/y1Ks4oP03hNsGYQh8OK vQGAIwfKV8vj7OD3bx2lz2xHYFwjl2RZJPQmFF7ObfGaoTWQQd46oSRxn2tZUNJ0+LiHSA N/0bBWdhk5MOrmNfcJ2b8dKY1He2yqICfc5FBLsjkuHbpfl1iu4cue1yZbwAG3jdFd0I9N eaxpbKK6kOjU3hh1lP7SOCy1jrJla8SilLPijl4fNoUCmEzEH69suO8/7DvKIw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751988; 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=RC09dGl/tBzE6mq76ewmtaQViiiepnE+GfeDm6vi4MA=; b=Oyk2ReUq3iQZWuOshWMH2Db69B5KYKHchzBcWn7uweX8cjTYGSo4okdu8lQRZB9Od4U5jT 8EOnRG2FzGLnQwBw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Marc Zyngier Subject: [PATCH v2 05/31] KVM: arm64: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:49 +0100 Message-Id: <59f527713562ad491df7c216eeee0378e0eb2402.1738746821.git.namcao@linutronix.de> 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. Acked-by: Marc Zyngier Signed-off-by: Nam Cao --- arch/arm64/kvm/arch_timer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index d3d243366536..8b1fe7c47d65 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -1099,8 +1099,7 @@ static void timer_context_init(struct kvm_vcpu *vcpu,= int timerid) else ctxt->offset.vm_offset =3D &kvm->arch.timer_data.poffset; =20 - hrtimer_init(&ctxt->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); - ctxt->hrtimer.function =3D kvm_hrtimer_expire; + hrtimer_setup(&ctxt->hrtimer, kvm_hrtimer_expire, CLOCK_MONOTONIC, HRTIME= R_MODE_ABS_HARD); =20 switch (timerid) { case TIMER_PTIMER: @@ -1127,8 +1126,8 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) timer_set_offset(vcpu_ptimer(vcpu), 0); } =20 - hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); - timer->bg_timer.function =3D kvm_bg_timer_expire; + hrtimer_setup(&timer->bg_timer, kvm_bg_timer_expire, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_HARD); } =20 void kvm_timer_init_vm(struct kvm *kvm) --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 7066322C322 for ; Wed, 5 Feb 2025 10:39:52 +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=1738751994; cv=none; b=BA/qHenzjw6rmkIf3eiugzXGB9j5ybvmHTjGnV5nih9Q0sC3uOv2lIZJ8K3RVoL+Qr7MC6dhp5drcI34+zGImctoCTKIRwGZf9JHJ/EeT+qVidwVzLZJHLkOdbaG0gZj+CbqO2RlDyYl4i/4cMopfy66+JVxzxjUSTw6ajL7nm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751994; c=relaxed/simple; bh=QIjdMhcXk3AaGSA9sCIuVEGRfUQxMwVR2twfx4ZqNE4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=terKTVp6TR4DqtC/2HkKFsPvb5q5uQ7Z5WMkXiMrNbiRO30WnJeVf+5npaAQ6JBsHhpRnh8YzbRfpQGsvAPFPyha2ayFTHFEfrqtv+0gP/wQ/HODJH3ARYuTgitbhe2+LwDw0x1DUtpkK8+bq60zDYEdhhrJR5nxLZeJb/JVjFg= 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=j28ENCQ+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3Vcu4tnp; 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="j28ENCQ+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3Vcu4tnp" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751988; 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=hloyeZK4o5RiVLme0GnbUDPJugjcXUmSipRi2u6gpRQ=; b=j28ENCQ+lx8d07J/jh7+2sxgs3iFFWlLrPXpuXPFcgj4FXF6rb1SMdVeKmcV2TqakhQQTG s3Z7xDF9Fet4rJzMEgxPjPd/P2w7o2taDJCcX0dchNyZ39eS7xCPIFLw1IcAqPvrowi6is pT4XhbE6o5YtFDI2hu4TyMqyYZP5d6exOdLg+Mf1kne5aA0tpaA3BDFnSUO++v7gsm5/ZM wHMFgteWlRSL1OOv+nQQlNogrXDt5WyfntLUea8MuTGcejls3E4Q/kQkeHtQqJrAtdRDTA 8202uvliWLzEo4yXtwDi97e4Kr2iwN3hyzuv6bpmtIOg9Mdn9p4TZUUPexR2dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751988; 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=hloyeZK4o5RiVLme0GnbUDPJugjcXUmSipRi2u6gpRQ=; b=3Vcu4tnp8UL3xCb2LVl2mMqVFNyB0UuuFl3il+23M51Yn7Ns3AJSE0odr/JoPVJWAqJgBG lb75o7bWfguO7VDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Huacai Chen Subject: [PATCH v2 06/31] LoongArch: KVM: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:50 +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. Signed-off-by: Nam Cao Cc: Huacai Chen --- arch/loongarch/kvm/vcpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index fb72095c8077..e721127c614e 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -1459,8 +1459,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) vcpu->arch.vpid =3D 0; vcpu->arch.flush_gpa =3D INVALID_GPA; =20 - hrtimer_init(&vcpu->arch.swtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNE= D_HARD); - vcpu->arch.swtimer.function =3D kvm_swtimer_wakeup; + hrtimer_setup(&vcpu->arch.swtimer, kvm_swtimer_wakeup, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_PINNED_HARD); =20 vcpu->arch.handle_exit =3D kvm_handle_exit; vcpu->arch.guest_eentry =3D (unsigned long)kvm_loongarch_ops->exc_entry; --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 705EE22C321 for ; Wed, 5 Feb 2025 10:39:52 +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=1738751994; cv=none; b=L5fq9zQV/u0QfFJAiqO0OvabPaOagEN3kGtiFNS57GZzADQ/9tdNcTNdX9zGu042IOhS3oxwuF9ZlER26Lkqd83FxZSruA2qDOpzi9WpBF1A7bd1npSLoxMqgg87DJPVM9s5JYczbyFMG60IX2E1AsplsTbla8Y2Z8j6Mx1ZZ4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751994; c=relaxed/simple; bh=+5MF1gZblDfbJX6Ub6UjJL8Dsye2HajJO7xW7GGMnZ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BhsUbshrxm0cPmSmzttlo6J14XKp266jxAZA6G6G+W3otJgEX8vECevlYO9SCmOEIJ60aCsh4KpT8e7e16jTxT4RChSmwu8TmmLLUQvDd7qGIRWWX9NkGnUKPpNiwmjRBPvaYgHTLT7YfJxPl0tWWfbc5TihU+fTLgGGqOfW0gc= 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=BRmmv4Ze; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3L9C+qi2; 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="BRmmv4Ze"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3L9C+qi2" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751989; 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=W6iU7/Sp5boVxyMgMrHuBvSPIlUirr0pttNKb2ZMRC0=; b=BRmmv4ZeWeipc46SLvuYZsdxWS98+esD2moSexyECgOEpDWc174ABw/qU5hINWWTVPP4N3 wT99jlmlGvy3QsokxFifF+nc2ZwoCbODYg55K3QoPQXESaqEOalo0+WDYQUHClROnkSmZF DODcN5xr5D2CpQFoyAq5blztflE9u2e7QLKd5cY5HwcA6aZBzy9I0sCDF85HGOC70yU8pV aT4hsDxaI9Btju4WBbNhwJKWesAach4M193vF1D4kP15A7fwuFq4b4miGrVIx2i6aYQU4I D0ucjvJBcOsh8eWSgCnv0ZOxdz/sd/sxq9E9wCK6uwFqu1GgUh+O8xJUK9wruQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751989; 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=W6iU7/Sp5boVxyMgMrHuBvSPIlUirr0pttNKb2ZMRC0=; b=3L9C+qi2fKE8c6b3+SYIjCzyO3+egzjS+IwG6eHFo9mF1txI2NdGIYbzCllqv5aLZNTrnd xumx8kv+eJiNaDBg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Anup Patel Subject: [PATCH v2 07/31] riscv: kvm: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:51 +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. Signed-off-by: Nam Cao Cc: Anup Patel --- arch/riscv/kvm/vcpu_timer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kvm/vcpu_timer.c b/arch/riscv/kvm/vcpu_timer.c index 96e7a4e463f7..ff672fa71fcc 100644 --- a/arch/riscv/kvm/vcpu_timer.c +++ b/arch/riscv/kvm/vcpu_timer.c @@ -248,18 +248,19 @@ int kvm_riscv_vcpu_timer_init(struct kvm_vcpu *vcpu) if (t->init_done) return -EINVAL; =20 - hrtimer_init(&t->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); t->init_done =3D true; t->next_set =3D false; =20 /* Enable sstc for every vcpu if available in hardware */ if (riscv_isa_extension_available(NULL, SSTC)) { t->sstc_enabled =3D true; - t->hrt.function =3D kvm_riscv_vcpu_vstimer_expired; + hrtimer_setup(&t->hrt, kvm_riscv_vcpu_vstimer_expired, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); t->timer_next_event =3D kvm_riscv_vcpu_update_vstimecmp; } else { t->sstc_enabled =3D false; - t->hrt.function =3D kvm_riscv_vcpu_hrtimer_expired; + hrtimer_setup(&t->hrt, kvm_riscv_vcpu_hrtimer_expired, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); t->timer_next_event =3D kvm_riscv_vcpu_update_hrtimer; } =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 79E8922C325 for ; Wed, 5 Feb 2025 10:39:52 +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=1738751994; cv=none; b=awcwebwQK50fVbV+VqpiITJ1AB2TMLRHlwhUl2F3yvgrCFvlbSOcEzdLxxRL+fy7Tapt13h0agv1oT2OA/kbHuqNd3w8JCzprZ3Vyuj3QS7PA7F/6T6k9phpD39+btP+D3uSqRU1Ep3mX4N7sHRJxcVAbwBwKxfYYwO16r88seA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751994; c=relaxed/simple; bh=ngcz8LegcHj9iV0oYkCnZEeLpPfwmAwaCf5gCihXRi0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GKnPRpAYkolGgBLlOWofm8A0B1RgFvDhEYvRy+xU8kir90cZoYarnWj06uumy/N0zAje8zQyExF6zec4L/yuOyiSeG1kxlaOT7OPsa8AWBnIPb+Po4JfTU0X9H4IepRhNrOpPUwbRO03+YOHZ11fsW9cZIL+KzcRTtR3C8nDF3s= 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=2Gin8O8Q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/s/BFjlS; 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="2Gin8O8Q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/s/BFjlS" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751989; 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=nm5swN+tTnX18LgifasfS+OO1X1LHz6T0cwrNQiP95U=; b=2Gin8O8QPTRqp71i2e78EaoV5BmC+B/uSqtnXcG3bUX3f1kSp6mFav47WSga91Xd16M7lK aJMvMdqjPANopiFj1d1gn48b0vMDfI+ahK5E39yrSfjoiE8YuoJBra0H3Hs85mywKgraNz XTpidofebeRK03sM1QdGevMhNPuSYPcf70m8mmuf66ui32ShePITeZCdggJIjlVfAtnVJB CQi208qWpyrAwwR7YqrA6mH8bUJ3Vlehj4W0dkMdUIvLNnZTvVRouPp9z/cFkEOslgxKGO nsa1wYxr8J/0kwLV/WTxbTd0sbh8wC229FXI+ZCVRm+L2fQGqeBzR3xnhMFBRg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751989; 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=nm5swN+tTnX18LgifasfS+OO1X1LHz6T0cwrNQiP95U=; b=/s/BFjlSTsk2BaHy8JP+XMk1CBbvYVyhSBJO2OvbnqJl9XiJ0y2UbmvVjPzeYG4DbDeveg kYaPhRaPieaGrwDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Sascha Hauer Subject: [PATCH v2 08/31] ARM: imx: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:52 +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. Signed-off-by: Nam Cao Cc: Sascha Hauer --- arch/arm/mach-imx/mmdc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index e898f7c2733e..94e4f4a2f73f 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -509,9 +509,8 @@ static int imx_mmdc_perf_init(struct platform_device *p= dev, void __iomem *mmdc_b pmu_mmdc->mmdc_ipg_clk =3D mmdc_ipg_clk; pmu_mmdc->devtype_data =3D device_get_match_data(&pdev->dev); =20 - hrtimer_init(&pmu_mmdc->hrtimer, CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - pmu_mmdc->hrtimer.function =3D mmdc_pmu_timer_handler; + hrtimer_setup(&pmu_mmdc->hrtimer, mmdc_pmu_timer_handler, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); =20 cpumask_set_cpu(raw_smp_processor_id(), &pmu_mmdc->cpu); =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 706CB22C324 for ; Wed, 5 Feb 2025 10:39:52 +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=1738751994; cv=none; b=hErcNLKpizMTlv85UjrOok26VEbhNS3TgyqwdaSmxrFxslcWPIg6LsAVyyf9P2SbumzKvoLX3vWpNhXu95CBw03KhD6EAzkHqFd7XGuxWj3gEiUe6rS+m34ysv28v/K+waJ1B0PAozJWWC5WvmmIwZY3Jq1QKptV/MSMHxQ6bOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751994; c=relaxed/simple; bh=ZWMFT0wDu7BzhhJL0tvD3ItSZriH1lPxKa7bj6Zt8io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nN4W6fNt68s+QXdMZb0MoOtOaFSOXs5CugMkeiPS/IX/YYpTHWTlP/RO46RTLjUjByh+qJZ+vv2v9Z7ciJQGjSZKcemgiUZOYnNn3tqOS7dD7PCCC4yX8rVyxVkOaCkOxzmkKEN5CnBYaOMOabxamcn7H3R/3AJmutTqPaIYyDA= 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=jtaziQCn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZiPnA5cc; 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="jtaziQCn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZiPnA5cc" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751990; 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=0Cuy6hGSdtklzsLc7CsatheTky22+D8bUAROhyka+iY=; b=jtaziQCnuW//YOM8LaHGBfL/rU7JA1V5gH/87bJTJ42v2EGYRQ+gNVXQTPhurgAWICfU5/ vzBdE1WG1eahlHlzzQ37UMmPR5El0ITxX+7KOO2ig987B+XpbgbTXa+Gxh/VSg1/XU0A4r KxNhU+g08K2+lwQBRgwOKDuyUVnMVnPbppflTkf7TnqqsxR279+dtIstIhDupO8pP5dvNO Zb+ZC/LcWJ/xGb8VLq8L13ONRGx1LXUV2E0bewyQgOmpLuCASMR/O5KouqtfZXx3IPGvz1 ELG+HMQaS2P/cbhivEAaSkTf2CF0066PT22JZkhkrT0Q9swicHImGLCaXSqofQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751990; 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=0Cuy6hGSdtklzsLc7CsatheTky22+D8bUAROhyka+iY=; b=ZiPnA5cckhfZRAhITsC16smjK8Io9ydFKeS7rEMLRuIAV8hAr+7mtZv6PJn9lF1DVumDs9 PWIUD50JDiH+UWAA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Russell King Subject: [PATCH v2 09/31] ARM: 8611/1: l2x0: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:53 +0100 Message-Id: <5ca584b1e32c34630bb15ccc84467c1e05059e66.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Russell King --- arch/arm/mm/cache-l2x0-pmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 993fefdc167a..93ef0502b7ff 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -539,8 +539,7 @@ static __init int l2x0_pmu_init(void) * at higher frequencies. */ l2x0_pmu_poll_period =3D ms_to_ktime(1000); - hrtimer_init(&l2x0_pmu_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - l2x0_pmu_hrtimer.function =3D l2x0_pmu_poll; + hrtimer_setup(&l2x0_pmu_hrtimer, l2x0_pmu_poll, CLOCK_MONOTONIC, HRTIMER_= MODE_REL); =20 cpumask_set_cpu(0, &pmu_cpu); ret =3D cpuhp_setup_state_nocalls(CPUHP_AP_PERF_ARM_L2X0_ONLINE, --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 0268A22C35B for ; Wed, 5 Feb 2025 10:39:52 +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=1738751995; cv=none; b=jHHR2FXjEAud/3fEK4A7sjh3HXDOr9cfPsaBD9DZ06dFRjqqY/J3+V/v9Xm4iK6M8hgIeI8KksoPcNAhSkaho35oi9LcazYmH/tIQDoU59LbJO9TWhu7IPh7ow6J1+T9F8BiHGK+hO76swppfk3/FFsegTzGSo06MAPYzfLocZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=ojoy9w3w2u/V0fNWANgt4dHWQoOsPR1wrw23CSoaDzE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JGXJqkdDa4Iy4Exjzg7ZUISTAt9bI5jVWJJTX8SOCVHhprSM6C7E6dbgU1aOKyQ1pRrmm5WiIIGEnkcX0nCpB8sRS0/5fEZL7mW20zdR5GZ438zJkvQXO9W/jXPwheIbuPX/XOFxUKApMy72NyFEcCtMlrjXiOi8+2dKATxpTp8= 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=ZAubTgJ9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ihEiI6e0; 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="ZAubTgJ9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ihEiI6e0" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751990; 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=h/84tRkM7FzLld2Jf1WWyNlKNjtaLhR1cHHFsiaB9AQ=; b=ZAubTgJ997563ddWkC4Xho9K6Ep85CpuYvYV1KQ6HxNFaxFug1Kjl87u8wSN3AUw7v0oPG gZ8f6dIqmYqdHDmhPXesrUlQE1JmJ6l/KCmovxNwTHfaqVk5JySit90BnI3puypUQ2Q8cb Pu7BzZd8DdbRQViITopgJD6P3chvMIcGhNz5/XW5U8m7D+jLDU72la/mR6gRjH98bZWtI3 p9WkTMWc/5s0TeFjzpqNigSyHVLZ638+OGvnKIxbksIGn31hNksqe5Q73uvnmzEJgJHS2O T5pp0jS49Kt/VT0ZFDskImoQahZIFpnyRolSfZ1wvc1+lbIEHOP9Mt8YcYFKYw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751990; 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=h/84tRkM7FzLld2Jf1WWyNlKNjtaLhR1cHHFsiaB9AQ=; b=ihEiI6e0PQJ7jEJKbDc1m8PvJsgY5sjCJ7Kp3GpJ2+vldKUWW3PuKGQb6WWhy7FUPqRq04 +M9PjUCXGTay6QDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Michael Ellerman Subject: [PATCH v2 10/31] powerpc/watchdog: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:54 +0100 Message-Id: <099ebf6d352094a56e22fdfe76582b50f8fd6029.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Michael Ellerman --- arch/powerpc/kernel/watchdog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c index 8c464a5d8246..2429cb1c7baa 100644 --- a/arch/powerpc/kernel/watchdog.c +++ b/arch/powerpc/kernel/watchdog.c @@ -495,8 +495,7 @@ static void start_watchdog(void *arg) =20 *this_cpu_ptr(&wd_timer_tb) =3D get_tb(); =20 - hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - hrtimer->function =3D watchdog_timer_fn; + hrtimer_setup(hrtimer, watchdog_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_R= EL); hrtimer_start(hrtimer, ms_to_ktime(wd_timer_period_ms), HRTIMER_MODE_REL_PINNED); } --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 6494922CBCB for ; Wed, 5 Feb 2025 10:39:52 +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=1738751995; cv=none; b=jxaEg3yPH8jzRPud6alqIJby0pGMzHIIq0g064p2nydORP+FtwzEspzq18EwQDof+ynbsBQtEMGh8qIdOEdc9wUavp/fyKwj0pIHR54dMuBcetarbOmmcdSAROp7bJH5RfdwmS8JBCvmuXn4vGs9OS/uzyd/QqIz2PM0Rg/ywm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=UfR+59KavMtZ11CfKcD2yOhyxGw2CjTyD/dBBlCLmDs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q3jo+bJuiLOkMeEKYMO0NBzjeO72B+8xwzNuU/1XXuLYdy+drGSUV9vuPvc/NB2gWMEysYhTMteEvlgnkBjPhYG7uTG9F/T4P9FtS//BAqtlSIEDynKtGDyujJu3gKvrb4rGQ7O5JTS5Dn4e+R1iPnNMvgG5nzJz5d3jau6MBoY= 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=gSytU5Sc; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=aUCEBDLm; 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="gSytU5Sc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="aUCEBDLm" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751990; 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=B502q2AlOmCNGRkwoS07XuMj1JmHp4WktLWVHz/Y3NA=; b=gSytU5SceUwkDKdQPQIeLw515FsfzEL2l/OdT0/GJkvCHqe+gj1hHxzEG9bPkzcNnB+6k5 AfE+CfQoqtETgqsxEQSx0/6aSnjxtwI6viLn3v5mkQtRrx+KCCM+sDAVu5RO6JK/XXL/La dPnNNzlj2zQIb4S5KT22hZd9gMf5Dg0rMw+mkD3vouqDoSKpRN4+1ZEmnka+kgAsOEAHtE AKj4389zfdI8RT5K+qFFQTaY9e4hVSlTlvY9XCXtxIgvz6+Hf6u9kFxGPz60PmncQPbfui cPrOjiio9UyVy+huv6JT5zx45/4yOBKORKuw7mX9CfxE336Z73KiKaLY+Y1P4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751990; 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=B502q2AlOmCNGRkwoS07XuMj1JmHp4WktLWVHz/Y3NA=; b=aUCEBDLmovq7OC5mZarOleKoCLwbGO0/X+fT3p8hghpCg5/Gja6bHADW93v3cNz3WyWeBH CDQDTNnPBrXGKHDg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Peter Zijlstra Subject: [PATCH v2 11/31] perf/x86: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:55 +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. Signed-off-by: Nam Cao Cc: Peter Zijlstra --- arch/x86/events/intel/uncore.c | 3 +-- arch/x86/events/rapl.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index 60b3078b7502..a34e50fc4a8f 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -347,8 +347,7 @@ void uncore_pmu_cancel_hrtimer(struct intel_uncore_box = *box) =20 static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box) { - hrtimer_init(&box->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - box->hrtimer.function =3D uncore_pmu_hrtimer; + hrtimer_setup(&box->hrtimer, uncore_pmu_hrtimer, CLOCK_MONOTONIC, HRTIMER= _MODE_REL); } =20 static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type = *type, diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c index d3bb3865c1b1..2b6cc2860836 100644 --- a/arch/x86/events/rapl.c +++ b/arch/x86/events/rapl.c @@ -274,8 +274,7 @@ static void rapl_hrtimer_init(struct rapl_pmu *rapl_pmu) { struct hrtimer *hr =3D &rapl_pmu->hrtimer; =20 - hrtimer_init(hr, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - hr->function =3D rapl_hrtimer_handle; + hrtimer_setup(hr, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIMER_MODE_REL); } =20 static void __rapl_pmu_event_start(struct rapl_pmu *rapl_pmu, --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 0287622C35E for ; Wed, 5 Feb 2025 10:39:52 +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=1738751995; cv=none; b=hrH+Tq+7lYdENmccwGA5vfLooF5XgDom8lRYyMbfaPakXQA/SjmX6fIh+HO5ywQ4buVGzuObfY9f6TOmDOWHkA5z+NgTb91NHTvTlrXF6RjYKWdbdlvCN1qBfDsN5Jg/auzqDLI/gtroMag8REviuU+dJdALYmqR4JmlfxUV7n8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=X1zs9uqKGi8uKdjEt3XVg3WcfuXPHIdBOG9LeRMoQH0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hiqXUnsJ/1aLEAURH64roplNsE7cO4Wi96RIAXCtNSYSVQtMh07LpW8lE/Fj2R3YCPYAwNDc5EPD7XMPZBKsNJoOxzLQS0Hn+1AW9/FGTSF8nZmx8o/GJxCXfveEWm+gwI4qR2fU5RvOO5MRrcbsoy9cm1Eiq/em7goNYuttHuk= 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=Ss0gwx2J; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5NY5bxDQ; 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="Ss0gwx2J"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5NY5bxDQ" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751990; 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=aqsFRu2Tbr71eXe3T9g4bJRh+N0SdDyyC7qIzDx3xRA=; b=Ss0gwx2JmGTgLfzw6fcd1rtWQJqZIwZwAYpJHsahRaipi93nj11z4juqkKbNyiyReS2i6a DkHJ7XIt29lt/KUSytttKmFBHUgL95PyNFlZwgrMUztbrpoYi/DBYVbSJ4eTv8bOb7RB2T bRSSM0oRkykwIZ8S6BBo0WhRNAiJm/2AKhikCj6Vy+RtCgNZWbFMpFbbhLXd+LbJev9Goz wS5DeP8fW1JQDKvgH6Pew9JCK0jh97b8hng+3EkYhpVHFSKwSc9qwm0bY3q8v8YX4M4j5F 6SLG420stBu5T5JnJ6yeO4ayrqwegks1m2kF+RX21CbufLVXZZj+NLL2o4u3gw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751990; 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=aqsFRu2Tbr71eXe3T9g4bJRh+N0SdDyyC7qIzDx3xRA=; b=5NY5bxDQwmILpP00IbTesi/Hcr0Eoo4z1qb9l/fx/kKNC26Bu0503DoJMqbEyHFAMNR3Po j5gwURvPq6dplsAg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Christian Borntraeger Subject: [PATCH v2 12/31] s390/ap_bus: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:56 +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. Signed-off-by: Nam Cao Cc: Christian Borntraeger --- drivers/s390/crypto/ap_bus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 26e1ea1940ec..62feb2c639d5 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -2326,8 +2326,7 @@ static inline int __init ap_async_init(void) */ if (MACHINE_IS_VM) poll_high_timeout =3D 1500000; - hrtimer_init(&ap_poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - ap_poll_timer.function =3D ap_poll_timeout; + hrtimer_setup(&ap_poll_timer, ap_poll_timeout, CLOCK_MONOTONIC, HRTIMER_M= ODE_ABS); =20 queue_work(system_long_wq, &ap_scan_bus_work); =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 0271A22C35C for ; Wed, 5 Feb 2025 10:39:52 +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=1738751995; cv=none; b=FjHAD6RJB35HrOxO5eZ+huFua458y/2P2gZ6b5lfAjzSBFZPBGzoaBVJyN+f+u+ju+YP1SilvLGH/1dC/nBoWnGy4dAC1zDtvenyIbjDuR6jvvH9eSZ13MKH69JnmdsW5BXMEXt+dYB6RUGs+QR3J/qtSXwLaOxaKi0GP9f3tvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=wYnISaD+ByGRsPCbpgLjJpzcm3qVaQ/m23YCxCu49Y8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WZWpY0TSS4ZXjm54AcFEHgNGD5ddSlkAkb9EXpGF3hzGALNJy5qjuI7SVFg1yiMPY5xH/kvW+Hrrmb/Ng4KsP5+Nwlg0tYWTkPcpqc4Ri6L+2gYt2QpqsosPUpX/aJW78UlNUXz997vR45dex81u8tMLGITTVBLaGHt9pjdbD2c= 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=RKyRJOOy; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BMEUTsU6; 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="RKyRJOOy"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BMEUTsU6" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751991; 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=Z1/kdljBMI1iJavjlWo8oHT1AdcLAhNVPwMF1Tuuk40=; b=RKyRJOOyiirNgBhR4cVqlBQuHHrWSeAnOnnFzii7IpX29M74fr3/2CbQJyFWtHO7l/syBA aWYedPD1YkpcWIEv9yUiIwFyiXG3fLIIcs8cpyiof+LzFXmzJZZA1PzHs8fGLpcAcyjgov 6hRSa2AQpGUc8EuFJZbuY/2nd20YSJesqkpHNJkCncfHuT5CbCN/Cr2utCcWwd6LizAAPY a0+IDjCvkk1iVsQ64gNcFR0VG0tAEU/rdp0ApHVodN5sYGB1JiDwABYriqwuAYGPThY8PZ wbXjv+WSoBh3kkL+jc6oQ0kYgRHhm6jlHwaZJOc3GKRPPjVuctt82yGpDsLxOw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751991; 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=Z1/kdljBMI1iJavjlWo8oHT1AdcLAhNVPwMF1Tuuk40=; b=BMEUTsU6sykoD77DGLiW8+ZGXAddFC5TuJZVGjbCJhPO7vFBX8uv3FCSuM7ls9l7LvaC4f /6UPoty1Dhn455CA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Peter Zijlstra Subject: [PATCH v2 13/31] sched: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:57 +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. Signed-off-by: Nam Cao Cc: Peter Zijlstra --- kernel/sched/core.c | 3 +-- kernel/sched/deadline.c | 6 ++---- kernel/sched/fair.c | 8 ++++---- kernel/sched/rt.c | 5 ++--- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 165c90ba64ea..357ff79cc760 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -916,8 +916,7 @@ static void hrtick_rq_init(struct rq *rq) #ifdef CONFIG_SMP INIT_CSD(&rq->hrtick_csd, __hrtick_start, rq); #endif - hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - rq->hrtick_timer.function =3D hrtick; + hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC, HRTIMER_MODE_RE= L_HARD); } #else /* CONFIG_SCHED_HRTICK */ static inline void hrtick_clear(struct rq *rq) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 38e4537790af..2d0f571f95e9 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1382,8 +1382,7 @@ static void init_dl_task_timer(struct sched_dl_entity= *dl_se) { struct hrtimer *timer =3D &dl_se->dl_timer; =20 - hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - timer->function =3D dl_task_timer; + hrtimer_setup(timer, dl_task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HAR= D); } =20 /* @@ -1839,8 +1838,7 @@ static void init_dl_inactive_task_timer(struct sched_= dl_entity *dl_se) { struct hrtimer *timer =3D &dl_se->inactive_timer; =20 - hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - timer->function =3D inactive_task_timer; + hrtimer_setup(timer, inactive_task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_R= EL_HARD); } =20 #define __node_2_dle(node) \ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1c0ef435a7aa..88923f1873f6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6539,14 +6539,14 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b= , struct cfs_bandwidth *paren cfs_b->hierarchical_quota =3D parent ? parent->hierarchical_quota : RUNTI= ME_INF; =20 INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); - hrtimer_init(&cfs_b->period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINN= ED); - cfs_b->period_timer.function =3D sched_cfs_period_timer; + hrtimer_setup(&cfs_b->period_timer, sched_cfs_period_timer, CLOCK_MONOTON= IC, + HRTIMER_MODE_ABS_PINNED); =20 /* Add a random offset so that timers interleave */ hrtimer_set_expires(&cfs_b->period_timer, get_random_u32_below(cfs_b->period)); - hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - cfs_b->slack_timer.function =3D sched_cfs_slack_timer; + hrtimer_setup(&cfs_b->slack_timer, sched_cfs_slack_timer, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); cfs_b->slack_started =3D false; } =20 diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 4b8e33c615b1..7a9ed4d93397 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -127,9 +127,8 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 p= eriod, u64 runtime) =20 raw_spin_lock_init(&rt_b->rt_runtime_lock); =20 - hrtimer_init(&rt_b->rt_period_timer, CLOCK_MONOTONIC, - HRTIMER_MODE_REL_HARD); - rt_b->rt_period_timer.function =3D sched_rt_period_timer; + hrtimer_setup(&rt_b->rt_period_timer, sched_rt_period_timer, CLOCK_MONOTO= NIC, + HRTIMER_MODE_REL_HARD); } =20 static inline void do_start_rt_bandwidth(struct rt_bandwidth *rt_b) --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 D014E22CBDE for ; Wed, 5 Feb 2025 10:39:53 +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=1738751995; cv=none; b=jFO99eXB4r8SPFzZe0NEZ7L89uIVzaEjDwLB/zlX1cDANeh05sCGBCoKRlYDpYbBh7juQFRNCH0wfdSRMnww9KBvRtr7O7dD3fmbA25X0a2MclTIcx5eG37u8P782VkZWnwOTInzb4sqyBUveKD355rNNh67MJygWbxTTmFkyF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=aI9capqMT/movR6q5LrdvKkRWo1xK8Pz4BBkZC9Ixm4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u1an9YMmksc1/YoFB3RGv2t9q5te7jxYk7XiYmW+X9Wdh0PsScQ33RV5mpxNb7WPHBpeNG5N3P8WJHfNg2iM7LgPZnZOyJpiZgcoI90F+tr2m0ARNTilWtmId/UPbyFHneddoZ1OhkWQ1beBSRCsq7vAeq9RFC2R+VghmseWaJo= 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=HVcd4JB+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=upMpXhW7; 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="HVcd4JB+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="upMpXhW7" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751991; 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=Vm3nYOWTnE711510Flxu5XSa1LkABAv3jwTcasCXcLA=; b=HVcd4JB+7vM1giYr/3wgLGjYwIftPwFsHAEUCTj1nlR3t2oiL5XLBBUlSpiMQ/140d4S5+ 9+/DjHbsrE3MR7vvJU2l1w96LAHpaZsNWH4jEne+a61IsxMveO2Y4beBMPIdueJOPMJ9T7 O90UuEp8QyTmroU7ZtEwb6x5hvLo4JclAlejtrj5f87Mgh8Dix3MmnVZlG1XwEJF906Mv2 vB0+7z2tA3TqJDrUkq8LBWdud1v42nlUaKaFSDLfRGq7f6EK0J5iBCyFkq/eiFTjsgmh5h OPcniJXpW3Xz41PSjgqzt4YpJpEdTTo82GVa7qH3V+vMItZfbPJkAZsLs1LZtw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751991; 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=Vm3nYOWTnE711510Flxu5XSa1LkABAv3jwTcasCXcLA=; b=upMpXhW7e0wn9eYJoM8ZFNsMoULi4JBw+YsmizyhMEbj497uF4cb6ot6oXaFRxTM5ZKhdJ xXula0+DxP9qGTCA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , "Paul E . McKenney" Subject: [PATCH v2 14/31] mm/slab: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:58 +0100 Message-Id: <030065d66630068f788caf9df15756fad404e754.1738746821.git.namcao@linutronix.de> 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. Reviewed-by: Paul E. McKenney Signed-off-by: Nam Cao --- mm/slab_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 4030907b6b7d..59578dafbf37 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1887,8 +1887,8 @@ run_page_cache_worker(struct kfree_rcu_cpu *krcp) &krcp->page_cache_work, msecs_to_jiffies(rcu_delay_page_cache_fill_msec)); } else { - hrtimer_init(&krcp->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - krcp->hrtimer.function =3D schedule_page_work_fn; + hrtimer_setup(&krcp->hrtimer, schedule_page_work_fn, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); hrtimer_start(&krcp->hrtimer, 0, HRTIMER_MODE_REL); } } --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 D1C3722CBDF for ; Wed, 5 Feb 2025 10:39:53 +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=1738751995; cv=none; b=PIHbvMKVO7tX6gzJqr0e3vWbCC1e+8TTH570Xyth/z6oreO9fMxmPuHaHXwQ8giV/UYl6pGSZE3LoqNnHsFMwKK60VQz7zXVX3Zfg+Sv0s6sYNKHKDuJ1F6B5KF0UMR15OPj3rr0NkUc7cwrZMlebbAEsCuPRGUzAsDH4mU0rk0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751995; c=relaxed/simple; bh=DgOKrnnvYS6CflUo/6avDXxBGbItaK4hPVrRmFhsgMs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pjSZE8FalzpUzMRIh1W16Dqk+nlK+g6Y/HMmRwXIJ6ZQ+UNdSibJ5yCA2JNsf5DGy5001cibE8iIbs2uzf657dIKmjq6NzvawERFZPusiLVtVIwnnKK1LolpycU37w3Wp8jbAp6x7CUOkMMCCPQ49gHSz2xC+d/O5bKBu1mxV/Q= 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=qkowxeCe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GVmOSP12; 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="qkowxeCe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GVmOSP12" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751991; 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=FZoRypk2La0UwOMOrnZ4ZH62e3tRQbToZGPXHQqsEkc=; b=qkowxeCe8djcXvZaA8kPL4rrH15zeZgEnbsSqimdwuMroFXM+5MEZAgJ7LOCESfLCaYhXp fj6qXeSRVct2g4zq0Gn+r/fi0VK7ViLpWJx8+Wn8MqwzbgGgntoNN4TWrpLp9aDbThk4lO DVlqtEIi38BZwdX19dnLRTHorPkzjHx3ZSGLLG32yYuloSWF0pU5V2uYgzJnOfOdDj/L60 d6DUziaP1rLqZFrxS+fHC4vPpAp9IfvNSPapgaSPj2Hj4qgnd+XwMHMYdNi/qKXheHNnB2 OcfSNFusaJBs94a9+Mq7ojVQIFSQlyYRDT+kJ2xZitohUfaSYAhUuSAYOzgKHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751991; 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=FZoRypk2La0UwOMOrnZ4ZH62e3tRQbToZGPXHQqsEkc=; b=GVmOSP12ij9TPf+REFuwOnv+3FxiMghcJvy3nPjpwX281TfQfu0uQILxs2ngCaj2Qyz8uh q/pQ8o9PoCof7vDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Andrew Morton Subject: [PATCH v2 15/31] lib: test_objpool: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:38:59 +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. Signed-off-by: Nam Cao Cc: Andrew Morton --- lib/test_objpool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/test_objpool.c b/lib/test_objpool.c index 896c0131c9a8..8f688187fa87 100644 --- a/lib/test_objpool.c +++ b/lib/test_objpool.c @@ -190,8 +190,7 @@ static int ot_init_hrtimer(struct ot_item *item, unsign= ed long hrtimer) return -ENOENT; =20 item->hrtcycle =3D ktime_set(0, hrtimer * 1000000UL); - hrtimer_init(hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - hrt->function =3D ot_hrtimer_handler; + hrtimer_setup(hrt, ot_hrtimer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL); return 0; } =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 03B0622AE45 for ; Wed, 5 Feb 2025 10:39:55 +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=1738751998; cv=none; b=JdjQjw80pZOlXDlEXLvRJHwz1k2ujWp5g+Jk1ceVkcW6zPvihvTGgtvJ9htPYYK5oZuwvPYKhiFZAHn/S8P/ard3FRZTyhjN6MxD0mCMVh/yVAFCoBgOt6uC3cnKiHWonzfxJtbM3kj5bEpr/NqaMMlMLlv+q7suLAXG6p5XNdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751998; c=relaxed/simple; bh=AZj+0U/8giZiNOi+t0HlLCsIw8GiuU1KWCwf+5dHwjw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X4s3oeD/JN+1IFhRuo9J/EERD9OfACMRjsLJ7yyzBxoU4g5oN3rkBZ/mzVO+hUUU7nK5uyNBTAL47jOYd93O2ddjzGgB0sh1q/MeZZy+/AnSMT2rUva5/N1gdvdTtY9tZD7Xf2ig6gksm00cRmk93NeWVHqxxOuS1Zdi4UMoRTE= 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=J/BIyhYE; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=C7EGpP6v; 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="J/BIyhYE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="C7EGpP6v" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751992; 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=hL50mMiiXMGWqicdM5KTVmwvFoZm7X6S13ahHy3wZrI=; b=J/BIyhYE+Z+O+GGDjTcqy1W2FDNHDJtdbg4d3DqJjNLgskTeu9FikCKbYRzoruMgVp5sfL 7+6hC0fciEDAvsny8KnB9hMlQo5YSk3tCTYtj2afSc/bi5SCGsnhZcZevaKaA7euNraW1S RbIzhSkdhVRm5b+jSQdorTV6VpHyhWlvkap6b5Ok1XKmyXkx1qXFt72JYxv4/U+TwXOpFm DffCRMmCdEyPoiosNl/fAEC1Cp3684EtJ8xn0fSJg5CngLYLSzs+j3ELD43JG5SRUAFtlb jgJ6/vgRYK2yNorJYi2kqKElBOUUgEOmpgR9SX57hhSknDOtapbax8Z3PcJeDg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751992; 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=hL50mMiiXMGWqicdM5KTVmwvFoZm7X6S13ahHy3wZrI=; b=C7EGpP6v69HNgvHfbn5LRnEho/2zZSj+a7KjmDyVseLU1eMr91Ddgun0j6bDaYYtNdpqtX l0gSyXn6dPo6DDDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH v2 16/31] io_uring/timeout: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:00 +0100 Message-Id: <80ca8d959f2cc67c75f6d61008e3bebfe7fbc30a.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Jens Axboe --- io_uring/timeout.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 48fc8cf70784..c5fb817b1e28 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -407,8 +407,7 @@ static int io_linked_timeout_update(struct io_ring_ctx = *ctx, __u64 user_data, io =3D req->async_data; if (hrtimer_try_to_cancel(&io->timer) =3D=3D -1) return -EALREADY; - hrtimer_init(&io->timer, io_timeout_get_clock(io), mode); - io->timer.function =3D io_link_timeout_fn; + hrtimer_setup(&io->timer, io_link_timeout_fn, io_timeout_get_clock(io), m= ode); hrtimer_start(&io->timer, timespec64_to_ktime(*ts), mode); return 0; } @@ -430,8 +429,7 @@ static int io_timeout_update(struct io_ring_ctx *ctx, _= _u64 user_data, data->ts =3D *ts; =20 list_add_tail(&timeout->list, &ctx->timeout_list); - hrtimer_init(&data->timer, io_timeout_get_clock(data), mode); - data->timer.function =3D io_timeout_fn; + hrtimer_setup(&data->timer, io_timeout_fn, io_timeout_get_clock(data), mo= de); hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), mode); return 0; } @@ -557,7 +555,6 @@ static int __io_timeout_prep(struct io_kiocb *req, return -EINVAL; =20 data->mode =3D io_translate_timeout_mode(flags); - hrtimer_init(&data->timer, io_timeout_get_clock(data), data->mode); =20 if (is_timeout_link) { struct io_submit_link *link =3D &req->ctx->submit_state.link; @@ -568,6 +565,10 @@ static int __io_timeout_prep(struct io_kiocb *req, return -EINVAL; timeout->head =3D link->last; link->last->flags |=3D REQ_F_ARM_LTIMEOUT; + hrtimer_setup(&data->timer, io_link_timeout_fn, io_timeout_get_clock(dat= a), + data->mode); + } else { + hrtimer_setup(&data->timer, io_timeout_fn, io_timeout_get_clock(data), d= ata->mode); } return 0; } @@ -627,7 +628,6 @@ int io_timeout(struct io_kiocb *req, unsigned int issue= _flags) } add: list_add(&timeout->list, entry); - data->timer.function =3D io_timeout_fn; hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), data->mode); raw_spin_unlock_irq(&ctx->timeout_lock); return IOU_ISSUE_SKIP_COMPLETE; @@ -646,7 +646,6 @@ void io_queue_linked_timeout(struct io_kiocb *req) if (timeout->head) { struct io_timeout_data *data =3D req->async_data; =20 - data->timer.function =3D io_link_timeout_fn; hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), data->mode); list_add_tail(&timeout->list, &ctx->ltimeout_list); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 03BA122B5B6 for ; Wed, 5 Feb 2025 10:39:55 +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=1738751997; cv=none; b=BkBpnfJf2wOUwZcocgFpxgjLMEpB7ahmum+8fc/2ltphF9VyXjJJFn6frjTUL6VNy2NuNwwCg6F2DBIzc/wCVojnlrP421z1G0JZLUeqTG63KyPppJxN3rUXiVxAGbu+pVq9LUy7kkPni2liqtu2H5B+mqKfjp4r8IQmUExCZyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751997; c=relaxed/simple; bh=7GUBoYMSq5znok224ISB6WAhFMAf727Cfbtk/NMb1QY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=scwfrhATX6ZiGWFPhIekGLjmSuQUGKBhrTFFT7LZNvVBg7yCkxDjCryG9u69rraI+a0DmTuLUEt/qpJd9d4ypqPObq+sso9I0o/ecl2KruoWWO1jKe+waS4ADyIhzZcCT1DbNKvTPp2S419EJ+5s1BfEeN6+KORMK2Gm0v9+uhk= 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=JY748rx+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JnCyxEW2; 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="JY748rx+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JnCyxEW2" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751992; 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=fyDjhJUuIm8B4iVIaKBKH/sSiyImu7CJ1Rqr4iuPoXI=; b=JY748rx+WYJjMtGSK2+5psjyyWC33xJNM5GqaPPnPmNINOCRqVCJwJyFZ8RsxpQmSGSxLM KDvScTkdeE1F6eQ0KBiuxvZdtzF1VP9Bu4Z2n95ErB98MtmFgDGMMizcdfixtgJCuv202C GfM2DOmTgo8toHXZII5c2O1U/O3eZoRFUbFvme+NwcI3b0aLqUefAnnKpknsUYPYzL7KWX lEe+LUZonHiKlhVPKBKp07zzk2PdX72FuOTt4yhus3AZASoIayaPAry52ErdAPH7WY0TWw hAWdmtJZcWg79U/1fl7LnDZa8CtKgib0eYP66TrwGd+VN4ogBgDty/Ka2PiU6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751992; 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=fyDjhJUuIm8B4iVIaKBKH/sSiyImu7CJ1Rqr4iuPoXI=; b=JnCyxEW2DeVlZr6BbopHc/LUPNn7QkLaELPNn8/9a8XQULxuGjpPkQ6KEdWCjDFLSwWNby ddVdbuWqaYqMClAA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Oleg Nesterov Subject: [PATCH v2 17/31] fork: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:01 +0100 Message-Id: <174111145b945391e48936d6debcd43caec3e406.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Oleg Nesterov --- kernel/fork.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 735405a9c5f3..e27fe5d5a15c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1891,8 +1891,7 @@ static int copy_signal(unsigned long clone_flags, str= uct task_struct *tsk) #ifdef CONFIG_POSIX_TIMERS INIT_HLIST_HEAD(&sig->posix_timers); INIT_HLIST_HEAD(&sig->ignored_posix_timers); - hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - sig->real_timer.function =3D it_real_fn; + hrtimer_setup(&sig->real_timer, it_real_fn, CLOCK_MONOTONIC, HRTIMER_MODE= _REL); #endif =20 task_lock(current->group_leader); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 03C4F22DF83 for ; Wed, 5 Feb 2025 10:39:55 +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=1738751998; cv=none; b=AwHsTLvjJmBMq0DNYVaGB95pRgThN27+jo4ZNJIWqcLYsMxLppqVnVzJOAtfvuvee51jK+6dAWPemG3k771AvXE8wQjaLAuKTtkA2ptdxyWlDzWSyawmcJGUb8EeQ5BawnNZRTLfMvhkjx/J+Ov5jJFar+SMMBMsCjD5LLezi8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751998; c=relaxed/simple; bh=1Oox9z0TTVmYTOeh66aL66CentavOCAi4D2hz4WTO9Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RsnGyMrUVVyiuHA+Sgcp3r6K9zBZ5+uTsQN9Z1m98Pw/X174z9T5C/GjJ/axwo/VHGjm9C6riOoP5mCnWvIfgCuadeMJmBp8Esy8hHqOJR9+7ZTCwBYqPN3jst7k89S+P3S5vb0nM7sgHZXgbhTY2sX1Md8nacpt6pME/0+BdmU= 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=ial1xsFo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0q046KmQ; 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="ial1xsFo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0q046KmQ" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751992; 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=KqR2/15ASJrEswysloe51ZKYrXuZFVUiqVH8Khg71NI=; b=ial1xsFoYkaUA2iJ1sM+7zXUJq3zzLr4t/Xnp1uCTBxfkTm5oNjntoxICgNjmMDmF4WVMv 7IZy5HV85lm9JkkFyCwKa7t/3eYDlFr8dWJIuckfTcSLXzufN9hrhyq14nW+IBu9zlMAEW aYZr52pmWLs6r7DUIV2S8mq75gLdth4FlAh+lZ3C8PjTENYkPdu4FuBODZ9VoXdmfepw56 UwaTrQrQNPGyI8h0FFw4ED/mutAXGs1M27dIHFC6QlyRX20z/Lc5iugfje/kG1v5QNh/PS MsyHhUCW0sqT1SzzwoYiB8p/SjvqtNPajjRKfpTJCC2vIjM4PpkZfxz2dW5jNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751992; 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=KqR2/15ASJrEswysloe51ZKYrXuZFVUiqVH8Khg71NI=; b=0q046KmQgIMoq114uOkZ4op9jIWPOsSH1SsctT8q+E/Yft8kCDpuyBazq49EXfI7+deBIw 0FAvpsZayl2YYXDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Peter Zijlstra Subject: [PATCH v2 18/31] perf: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:02 +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. Signed-off-by: Nam Cao Cc: Peter Zijlstra --- kernel/events/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 0f8c55990783..59059e348844 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1147,8 +1147,8 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_p= mu_context *cpc, int cpu) cpc->hrtimer_interval =3D ns_to_ktime(NSEC_PER_MSEC * interval); =20 raw_spin_lock_init(&cpc->hrtimer_lock); - hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); - timer->function =3D perf_mux_hrtimer_handler; + hrtimer_setup(timer, perf_mux_hrtimer_handler, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_PINNED_HARD); } =20 static int perf_mux_hrtimer_restart(struct perf_cpu_pmu_context *cpc) @@ -11366,8 +11366,7 @@ static void perf_swevent_init_hrtimer(struct perf_e= vent *event) if (!is_sampling_event(event)) return; =20 - hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - hwc->hrtimer.function =3D perf_swevent_hrtimer; + hrtimer_setup(&hwc->hrtimer, perf_swevent_hrtimer, CLOCK_MONOTONIC, HRTIM= ER_MODE_REL_HARD); =20 /* * Since hrtimers have a fixed rate, we can do a static freq->period --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 BBD3122D4FA for ; Wed, 5 Feb 2025 10:39:55 +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=1738751997; cv=none; b=YN8/oZM2Lm71VXAl5q6igaFd4DL0APf9+NRDuYcCgqq2Rp5TbUhOesxqFp9TRDCQuMtsE66a9FrlYiqfhD8DIz9hxMo1OcAEdUSBnRKZJckCvqXrZee/h87nTnRjnVhEPu2SBdH4pCOLo5LIul2Hs0qIjPYaIm3oPlWo3+t+NAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751997; c=relaxed/simple; bh=CvoAJ16kV0lvWMkQs+qHm8R9UjaR8Zh9Owp9/4UQQDU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G0GOssAUnCv1Ru3HKtJuNt26r3+3NZT70GkQ32PsjbiW93cMqD5EUThE9994eTpfLbCJe/zDuvErmjy1bFphKa7NBjZhQ8/6G+zaEGPgv5jSle0s76Frt2hqL7uwgFyIXaccrDhyrYMaelP+bXGmr23ZoLN5Xppj/HVcxvCly4k= 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=YYzzH9P/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=H/d5y7gg; 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="YYzzH9P/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="H/d5y7gg" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751992; 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=3Erq6ZPL0l/t9gxwTNufEWCUeKPTMeHf6c8zI/WqGgw=; b=YYzzH9P//Y61Yg0K0dp5DdORjfpG3l07W7Sa7tqvcb6XFXARZJwiPUmMVXx+99Lm6/vOyd WBNN0x8rsEndbkZZrQUV9Y277nFdEwIDVK8yxuBbi0BSnW2hsWXypK1yNcGP9UeyYHvN2I /ZZK7Hgo2un8TRi42T8lxHh0CeTPw9Sa6K0OL3D3AIYpvgrJrQK9VFVT7cLpIRDA9JONyg sp5xnkrdhXgNyeqoVuxubBJpwrIYuT3Y4qZEa5UWJOg5I64oItpy3hnQRlnn3iEJGN4iIH oYLVVyLpxLXGp88e60zSFhnASxQ/BKVpBOPfXtYHTmvYOrLh68aUBrO6dip+DQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751992; 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=3Erq6ZPL0l/t9gxwTNufEWCUeKPTMeHf6c8zI/WqGgw=; b=H/d5y7ggCePsW+rqe/PxzCeQT56CVBCLxB276qoUcYAN/Q4q44tmtzNc7g3RF7/xB/31rZ hFbEPDozJ3tdzzAw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Christian Brauner Subject: [PATCH v2 19/31] timerfd: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:03 +0100 Message-Id: <2d1f26c2c2f3ad15f1ca1a09ecb9d760cafef4a6.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Christian Brauner --- fs/timerfd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/timerfd.c b/fs/timerfd.c index 9f7eb451a60f..cee007e0d978 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -205,9 +205,8 @@ static int timerfd_setup(struct timerfd_ctx *ctx, int f= lags, ALARM_REALTIME : ALARM_BOOTTIME, timerfd_alarmproc); } else { - hrtimer_init(&ctx->t.tmr, clockid, htmode); + hrtimer_setup(&ctx->t.tmr, timerfd_tmrproc, clockid, htmode); hrtimer_set_expires(&ctx->t.tmr, texp); - ctx->t.tmr.function =3D timerfd_tmrproc; } =20 if (texp !=3D 0) { @@ -429,7 +428,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flag= s) ALARM_REALTIME : ALARM_BOOTTIME, timerfd_alarmproc); else - hrtimer_init(&ctx->t.tmr, clockid, HRTIMER_MODE_ABS); + hrtimer_setup(&ctx->t.tmr, timerfd_tmrproc, clockid, HRTIMER_MODE_ABS); =20 ctx->moffs =3D ktime_mono_to_real(0); =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 5B23722DF91 for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=RmkfjIohVP6zM84wmqGXWoBRxwoZx1YOuSqf/XWGAk2qvL05363SdhUzI6aiiPMq8y6x13zbmbpIghPC4/YgfVwD5H31NMFY7LyXKquAYqg6LKGoQ3RUAyj0z2NuUAW3ekVSC2hwVrpv5vXQD1TNHSx1XjmykXecOco8XUqFKO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=40Z28cQpBtR6oIW/eao5gQOUrtoDvxU5hvpTOaulsBQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u/sN7alJ1xxpH6pLsg/Dd/I60SHRwdMsmMZ/wOTHKd/uV9tPKbiTpVsDfmBks2P64BFVJPGjLS8Dmk5IScPOIu3mER3scdufsyvX9xmBwPKTCBWCisNMXWEj0zNX7C+5rW773JkakbroWj5iZHzp3nG9jPqGXiwmc1XEfVFi5Sw= 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=XPx/twKT; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zHm/Q/D8; 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="XPx/twKT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zHm/Q/D8" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751993; 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=pGfDS6ZDEk08bix2mTnocbNLz1H/h2zWQ2e/ZUBvbi4=; b=XPx/twKT7A4xKTpPKCX5bwhy/qBQYxW6GStA1L0xQp856EcmaKGVNJuNPkst9/dCUIzE6+ QwU8B8mlrbgNlgxvkWyB9SRw3/8nvBnklhMSUj5SYEseaFHNKXgJRayL16bTFvV/FWQ8Vd spwH/hrOzX7kzNvzWUuztYduj3EEwymv3BpYq1Ybfi7Rx1pWohvjP+1nKEZDux4WRgce4o YbnjiHXUzLRVF2PLiw2DqyxbuGpZft2ONtqDbmUSkUHBwLHpKNnPTwr3pyWsrSi4tVBaaq 4fm3q0wcfX4mBwvobgXIG3OBQqeNhhzcosHWemkUQj8fuI6bJJBlhLEofiO/Ww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751993; 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=pGfDS6ZDEk08bix2mTnocbNLz1H/h2zWQ2e/ZUBvbi4=; b=zHm/Q/D8/uj9VYQdo0nsujVQ7OHtLR2Kt2+RJGuAhjcPKFywwpLuFsmlZVo0VhTrgu8teX tBWVuic3EhIp8EAg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , John Stultz Subject: [PATCH v2 20/31] time: Switch to hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:04 +0100 Message-Id: <170bb691a0d59917c8268a98c80b607128fc9f7f.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: John Stultz --- kernel/time/ntp.c | 3 +-- kernel/time/posix-timers.c | 7 +++---- kernel/time/sched_clock.c | 3 +-- kernel/time/tick-broadcast-hrtimer.c | 3 +-- kernel/time/tick-sched.c | 6 ++---- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 163e7a2033b6..b837d3d9d325 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -678,8 +678,7 @@ void ntp_notify_cmos_timer(bool offset_set) =20 static void __init ntp_init_cmos_sync(void) { - hrtimer_init(&sync_hrtimer, CLOCK_REALTIME, HRTIMER_MODE_ABS); - sync_hrtimer.function =3D sync_timer_callback; + hrtimer_setup(&sync_hrtimer, sync_timer_callback, CLOCK_REALTIME, HRTIMER= _MODE_ABS); } #else /* CONFIG_GENERIC_CMOS_UPDATE) || defined(CONFIG_RTC_SYSTOHC) */ static inline void __init ntp_init_cmos_sync(void) { } diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 1b675aee99a9..58351f537a04 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -381,7 +381,7 @@ static void posix_timer_unhash_and_free(struct k_itimer= *tmr) =20 static int common_timer_create(struct k_itimer *new_timer) { - hrtimer_init(&new_timer->it.real.timer, new_timer->it_clock, 0); + hrtimer_setup(&new_timer->it.real.timer, posix_timer_fn, new_timer->it_cl= ock, 0); return 0; } =20 @@ -747,7 +747,7 @@ static void common_hrtimer_arm(struct k_itimer *timr, k= time_t expires, /* * Posix magic: Relative CLOCK_REALTIME timers are not affected by * clock modifications, so they become CLOCK_MONOTONIC based under the - * hood. See hrtimer_init(). Update timr->kclock, so the generic + * hood. See hrtimer_setup(). Update timr->kclock, so the generic * functions which use timr->kclock->clock_get_*() work. * * Note: it_clock stays unmodified, because the next timer_set() might @@ -756,8 +756,7 @@ static void common_hrtimer_arm(struct k_itimer *timr, k= time_t expires, if (timr->it_clock =3D=3D CLOCK_REALTIME) timr->kclock =3D absolute ? &clock_realtime : &clock_monotonic; =20 - hrtimer_init(&timr->it.real.timer, timr->it_clock, mode); - timr->it.real.timer.function =3D posix_timer_fn; + hrtimer_setup(&timr->it.real.timer, posix_timer_fn, timr->it_clock, mode); =20 if (!absolute) expires =3D ktime_add_safe(expires, timer->base->get_time()); diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index fcca4e72f1ef..cc15fe293719 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -263,8 +263,7 @@ void __init generic_sched_clock_init(void) * Start the timer to keep sched_clock() properly updated and * sets the initial epoch. */ - hrtimer_init(&sched_clock_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - sched_clock_timer.function =3D sched_clock_poll; + hrtimer_setup(&sched_clock_timer, sched_clock_poll, CLOCK_MONOTONIC, HRTI= MER_MODE_REL_HARD); hrtimer_start(&sched_clock_timer, cd.wrap_kt, HRTIMER_MODE_REL_HARD); } =20 diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadc= ast-hrtimer.c index e28f9210f8a1..a88b72b0f35e 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c @@ -100,7 +100,6 @@ static enum hrtimer_restart bc_handler(struct hrtimer *= t) =20 void tick_setup_hrtimer_broadcast(void) { - hrtimer_init(&bctimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); - bctimer.function =3D bc_handler; + hrtimer_setup(&bctimer, bc_handler, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HAR= D); clockevents_register_device(&ce_broadcast_hrtimer); } diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index fa058510af9c..c527b421c865 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1573,12 +1573,10 @@ void tick_setup_sched_timer(bool hrtimer) struct tick_sched *ts =3D this_cpu_ptr(&tick_cpu_sched); =20 /* Emulate tick processing via per-CPU hrtimers: */ - hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); + hrtimer_setup(&ts->sched_timer, tick_nohz_handler, CLOCK_MONOTONIC, HRTIM= ER_MODE_ABS_HARD); =20 - if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && hrtimer) { + if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && hrtimer) tick_sched_flag_set(ts, TS_FLAG_HIGHRES); - ts->sched_timer.function =3D tick_nohz_handler; - } =20 /* Get the next period (per-CPU) */ hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 801FB22DF9F for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=rFNptuMWAKvZNqNBAYMBW7bJyG3Ls9CRkhKpt+WAi9ODJ5JTT8i1NcfsrejlERKQbmQKMKVVi9nfAriQgf1UTefRNduFkg5jm/6bISGwN0e904FPP/mQSUoBAe39XboGtrVtuyMYMRUxSYdfzCSz2LjR06dZKrMAhwxYUkxnIcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=5yZXT3sOR+HWy0oC0w916Zn0isWJPDL29E6OWP6h8r4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DkzfxvegLk9QWAf9mYIvPAayxvE40dDXKiabCQ4ONgHSiYqdU6W1bwMJTVE9wtCjWRCsnBF+k56naG7/SlOfbYt6ZxDDcuMLqTHgKX/icWTA7mTt4msfO5BwwYoKLZIjC+hbyTfPbwe6FwXh3RZV8XFR21Wm7bJnJiE73T0tEJU= 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=Esus7ogu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5W2lGiHq; 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="Esus7ogu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5W2lGiHq" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751993; 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=iB4BM5gskl63TnlFkrADlbgRWdDC/wai5RBmxqiwi6k=; b=Esus7ogutJoihiAPlMZhfmsr8G+DG/vdopHfVJYfYAecSmTVHLTHG47p6XP74zPkNsdb0d qUlwXsvR6g6rxrobDCabxkPNDxR9QI2QdBKlbKGfszcY/UTZBsdmPWg66sG7y67F8UwNOK B1Eb9EYQ53AjP+C1qFaeVz0PpG5lEJjalqx6OStIq+EYOMGUNfyeWfj9y6mziR0QVK2Vwn xgmFOgoQttfIkzkuXIIDVA/Xk2PV4tvVABv1JpR2sIis1jd219FQx79ky7ZPTsbq0vF5vr sKqruiENI/K6YQvkq77cY4lLXjp/0izuK/9aF+IzL/jMZJJqvJCfcAvfq6KKOg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751993; 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=iB4BM5gskl63TnlFkrADlbgRWdDC/wai5RBmxqiwi6k=; b=5W2lGiHqSM2OaegdHCZgiD0IbSf+4vpcWLOl7qKL7HZZ9s7nEru1P2Y9mzjOm0w/SxVhRQ 1B9VApCIu8mH7JDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Alexei Starovoitov Subject: [PATCH v2 21/31] bpf: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:05 +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. Signed-off-by: Nam Cao Cc: Alexei Starovoitov --- kernel/bpf/helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index f27ce162427a..672abe111282 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -1284,8 +1284,7 @@ static int __bpf_async_init(struct bpf_async_kern *as= ync, struct bpf_map *map, u =20 atomic_set(&t->cancelling, 0); INIT_WORK(&t->cb.delete_work, bpf_timer_delete_work); - hrtimer_init(&t->timer, clockid, HRTIMER_MODE_REL_SOFT); - t->timer.function =3D bpf_timer_cb; + hrtimer_setup(&t->timer, bpf_timer_cb, clockid, HRTIMER_MODE_REL_SOFT); cb->value =3D (void *)async - map->record->timer_off; break; case BPF_ASYNC_TYPE_WQ: --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 A00D022DFA7 for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=Z74+e2JEIS6M/7vYhmE1BYIDZXO+tVon0s2brPp45JVpjE+mpzsonv01F/vhr4/Q4BGwIJlQ5oVsVHntt0WqP2tDGJOXB4b3bhUaVmq5Qb/9HnvoMmGBE5zKSA4fBW2WXlBw8SmcJ1y+0q28U2XQsiHYQ4SeXVuQPUUM4PotQ4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=7uVrsBENQjyE8JBIUS16xu+0TE6BodeWyO/rAxQCkC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b8/CW7rAZWCHdMRikZtVBYlWAhW9DKnhH5Lilu0MSZeSAz+dCr2s6sOYf8mYDEdCfSnk8hVVLNoAkUbldyr6aCW72hQ3MZYnPs4SShSKVA8PRxwz/+sIsWBnrcnk3MKqZC4Ty7R1XPXqITQcsoD+MAu4IFUPJANrpOYd9gHnyEw= 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=XNu4iNS5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wOBFfdLT; 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="XNu4iNS5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wOBFfdLT" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751993; 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=obyB+yvY2qjQDUyuUkgTMZqn84tctt91SdNK4ny0zHw=; b=XNu4iNS5OQuUVwwhW1WaqAg2awHUZEYHiqRCtw97ju9WMybqLWA+E1iyTTeLPf6SH5W2UB yt8f0kFQxu4qEdFkplEf7QIjMJXGFBCeB0g9uKF9WxvoW2ccX6o9H7PDkWYYVnIEFy0um5 6w8NQrDFJp0Ydrweku9Q8hIF+1pJnkOtEIej6qXqa+q2XqxKqaEFLtqhnSYdQj6ASvvgTk ynT1DWNbjW6v63RCkK0wDDl0kDTN0UJlccNtQo7dT44fkvfUG/WpvEI7M2jetLDf1IKusZ BdhxqTbECY6OEE4oUEkLuqV3ZqNXRZu0ZHUT3Tx+K7/7qG67Y07n2EyXu8Nn2g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751993; 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=obyB+yvY2qjQDUyuUkgTMZqn84tctt91SdNK4ny0zHw=; b=wOBFfdLTl/Rz0Ljd4qVhUukn1huRCHAvUIWRddjTOQ1VQUyLgkPAcJG8V98SIflPaaGiTf NB8kz1c+QwVttcBg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Richard Weinberger Subject: [PATCH v2 22/31] ubifs: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:06 +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. Signed-off-by: Nam Cao Cc: Richard Weinberger Acked-by: Richard Weinberger --- fs/ubifs/io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 01d8eb170382..a79f229df475 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -1179,8 +1179,7 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubif= s_wbuf *wbuf) wbuf->c =3D c; wbuf->next_ino =3D 0; =20 - hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - wbuf->timer.function =3D wbuf_timer_callback_nolock; + hrtimer_setup(&wbuf->timer, wbuf_timer_callback_nolock, CLOCK_MONOTONIC, = HRTIMER_MODE_REL); return 0; } =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 9E9F022ACD6; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=EqHV9sbb/SkA1+DhP5W+X6JgTZz6n4gjk2SD61HCAObQa3ZBc7mK+X4JmtpS0jP5PRj/8s09WReOUUw3AfO2DgtAfQ6U8XxuqJBJ/r324m441TMTqP4PVKXCei1L8wJjDtqU/NxYl6XY+S8uGaDhUvUEbYdNTlnjJ6cowYg5LOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=AMjna7+7OWsw2aJekWWPLgo4H/lNOzaMTw/WhoTLB6Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UA7hvKsrCqPU8mRdZa6kaa8R0ADRW47toy8ijEhw4k6lvq9KnJMbCt0iA2WeADCGgtgWlokVgRrEyXhnRKqE1heZ0C7CHeuf9GcQgQ77OY7Xt2yL32BC/dvsqQF++jzxe/bi3HLJMHeOQ3FFyJHI69Jb58MgUyLLHOJuzHXFn9k= 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=OgIFI4DU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2MkVDWvb; 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="OgIFI4DU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2MkVDWvb" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751994; 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=bWOsbeBXYe4P9Ey/QKmxFEQWVZvEI9fDikxtPGxLwCw=; b=OgIFI4DUO8J5bYuE4Zm2bHxV1S+PMB4KVkZgSX66PQX7xXUC87r7jVWm7767dg9quDM5LL AZEG9dcp0LAH8eV4kYNJLQ+MluhNk+ZBiOhClLq8RmvTE86rKabBS1HY94K86xD76fhPJL gi3srorMIplUUC1qwlT0FsZuXKvgOVEzUGXE8oGGy/dKP4r7oiBXcEW21KuhtLrn4kykXo kTwfaNL4vLwXnJwVLld3vAUEHURmzDI8cDSSVfuVMvECD1WQ1bu0tiltFi5frfHEL+P7wB BrJDTLfIVXw8i+g4eX5G3NmXp+LePBhYP8eHCA4tU0Kfn4G7pfsJGb+ISE1jYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751994; 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=bWOsbeBXYe4P9Ey/QKmxFEQWVZvEI9fDikxtPGxLwCw=; b=2MkVDWvbnMnhUfU4YQg7QyUj/XQaIPs/rHUx3IpPjx5AJtVC/2y5QVDMgbhmepZZpRb/77 QEsfNF0Znm8a8yDg== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Wim Van Sebroeck , linux-watchdog@vger.kernel.org Subject: [PATCH v2 23/31] watchdog: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:07 +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. Signed-off-by: Nam Cao Cc: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org --- drivers/watchdog/softdog.c | 8 +++----- drivers/watchdog/watchdog_dev.c | 4 ++-- drivers/watchdog/watchdog_hrtimer_pretimeout.c | 4 ++-- kernel/watchdog.c | 3 +-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c index 7a1096265f18..0820e35ad2e3 100644 --- a/drivers/watchdog/softdog.c +++ b/drivers/watchdog/softdog.c @@ -187,14 +187,12 @@ static int __init softdog_init(void) watchdog_set_nowayout(&softdog_dev, nowayout); watchdog_stop_on_reboot(&softdog_dev); =20 - hrtimer_init(&softdog_ticktock, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - softdog_ticktock.function =3D softdog_fire; + hrtimer_setup(&softdog_ticktock, softdog_fire, CLOCK_MONOTONIC, HRTIMER_M= ODE_REL); =20 if (IS_ENABLED(CONFIG_SOFT_WATCHDOG_PRETIMEOUT)) { softdog_info.options |=3D WDIOF_PRETIMEOUT; - hrtimer_init(&softdog_preticktock, CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - softdog_preticktock.function =3D softdog_pretimeout; + hrtimer_setup(&softdog_preticktock, softdog_pretimeout, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); } =20 if (soft_active_on_boot) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_de= v.c index 19698d87dc57..8369fd94fc1a 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -1051,8 +1051,8 @@ static int watchdog_cdev_register(struct watchdog_dev= ice *wdd) } =20 kthread_init_work(&wd_data->work, watchdog_ping_work); - hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - wd_data->timer.function =3D watchdog_timer_expired; + hrtimer_setup(&wd_data->timer, watchdog_timer_expired, CLOCK_MONOTONIC, + HRTIMER_MODE_REL_HARD); watchdog_hrtimer_pretimeout_init(wdd); =20 if (wdd->id =3D=3D 0) { diff --git a/drivers/watchdog/watchdog_hrtimer_pretimeout.c b/drivers/watch= dog/watchdog_hrtimer_pretimeout.c index 940b53718a91..fbc7eecd8b20 100644 --- a/drivers/watchdog/watchdog_hrtimer_pretimeout.c +++ b/drivers/watchdog/watchdog_hrtimer_pretimeout.c @@ -23,8 +23,8 @@ void watchdog_hrtimer_pretimeout_init(struct watchdog_dev= ice *wdd) { struct watchdog_core_data *wd_data =3D wdd->wd_data; =20 - hrtimer_init(&wd_data->pretimeout_timer, CLOCK_MONOTONIC, HRTIMER_MODE_RE= L); - wd_data->pretimeout_timer.function =3D watchdog_hrtimer_pretimeout; + hrtimer_setup(&wd_data->pretimeout_timer, watchdog_hrtimer_pretimeout, CL= OCK_MONOTONIC, + HRTIMER_MODE_REL); } =20 void watchdog_hrtimer_pretimeout_start(struct watchdog_device *wdd) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index b2da7de39d06..6a98dbc931ac 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -797,8 +797,7 @@ static void watchdog_enable(unsigned int cpu) * Start the timer first to prevent the hardlockup watchdog triggering * before the timer has a chance to fire. */ - hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - hrtimer->function =3D watchdog_timer_fn; + hrtimer_setup(hrtimer, watchdog_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_R= EL_HARD); hrtimer_start(hrtimer, ns_to_ktime(sample_period), HRTIMER_MODE_REL_PINNED_HARD); =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 5F7AD22DF9E for ; Wed, 5 Feb 2025 10:39:56 +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=1738751998; cv=none; b=SJ3jdN2mHdxZ6M3zGmhe0ivvX767tPkUBAhXxZj4yCYOQ6n+kh3eW3B07TRiUmjauxcPzAzWny7pWKRRclsE8tx8bg5nn9ll2N3jZXvxh8TdkMjVmX4sss04nLTGXwskgBsmFgGmzJ4HyVoshmmXuEIdwUh/B44COfb/ZY1wx0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751998; c=relaxed/simple; bh=GGBXk6f48Of3riytdkya0PlY1YMazvmfX9MK1nyV4u0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AIk+X6Z76QLFFyACKOIIwpgt83bwiM2dsU62/zrg6jrukCfyg5qD5lzqotKoLUgMJdR/xm+FHykeNSdLJ86lGITAI878WchLyk/QyJopU1JfnAbdJ+9rSBk2Yu1tCR5hQVfkmN0Ta5h6an3EWAJrp0UEyNqP41PeZ1EDHTDwGN4= 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=4bXgrzJG; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rkAJO11a; 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="4bXgrzJG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rkAJO11a" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751994; 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=vfzgxjYfbEWz4//KHQQPlOhiuQtZIwViWTzsUTh7j6s=; b=4bXgrzJGWqZdQt/f1iANLvjzr4I1DSmJ2n3ZmMjvBE0hBX0AIFY2X3GcQaQntIX3WKEkFq kTJrreUc3ZTcAYamtKlJSoy4Sj61kv5o9tGa+oKDFxDJalPvso4USV9qNFpdNxpW4oSxZG guFUkR2hfrN7ApMKVXqwxEk6DlEZsPh8QlvfBLcmI9ptsfeNXzq2eQ5Iwv4buBZxrOWMYh xXF3NiVTvHynLRBU1c+dDKb2Yi84MkqJ7Eq7iE1aClbb/L9LcH8IKv9qedm4G3mbCT8ng6 jOLfFaO2HXpRNWIZHA3To6Q1zdEiDP4lNvgldJ2//nqNkZa65gkJkf2g5Ey2GQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751994; 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=vfzgxjYfbEWz4//KHQQPlOhiuQtZIwViWTzsUTh7j6s=; b=rkAJO11ap8Y21IPB7VGZudr/SI9zSJeHWaI6zs5BMlJmxuGm8lPc1IdRDl7MoOkUVrCjoS pO5GkTtYG9SjbYDw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Steven Rostedt Subject: [PATCH v2 24/31] tracing/osnoise: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:08 +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: Steven Rostedt (Google) Signed-off-by: Nam Cao --- kernel/trace/trace_osnoise.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index f3a2722ee4c0..15999532956a 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1901,8 +1901,7 @@ static int timerlat_main(void *data) tlat->count =3D 0; tlat->tracing_thread =3D false; =20 - hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); - tlat->timer.function =3D timerlat_irq; + hrtimer_setup(&tlat->timer, timerlat_irq, CLOCK_MONOTONIC, HRTIMER_MODE_A= BS_PINNED_HARD); tlat->kthread =3D current; osn_var->pid =3D current->pid; /* @@ -2456,8 +2455,7 @@ static int timerlat_fd_open(struct inode *inode, stru= ct file *file) tlat =3D this_cpu_tmr_var(); tlat->count =3D 0; =20 - hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); - tlat->timer.function =3D timerlat_irq; + hrtimer_setup(&tlat->timer, timerlat_irq, CLOCK_MONOTONIC, HRTIMER_MODE_A= BS_PINNED_HARD); =20 migrate_enable(); return 0; --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 9FFF522DFA6 for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=kFwdeuDBzv/7nB54U52lDVdaSdCer4gq7tBEwi9RdLmVvFSpZvudaWD8U0bLaZLV1krRB75kgEjHOBzTq4GCNYQlnDPtQDnIjv92VP6bS9ohL3viA8AAbEEiYYsweKBn/YaWkRWNRa1tW09LaH4WiXK68vNFJhlgJ6+JqA62chY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=cjGLDB4uw7VJdeD9v7ShG6mzkICmyEUJnIKg6kx80YY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fujCAd8pS/NYJn4CgIDVOiOVZspf8qKWbTAz8xJxY4Jng7AZWuhNz3aa0J8buswIn1KSZmCo+gfwhhKMEKbFXzy8gq9/fK6/fmk3Vb0q3I/nYhdRjs9I/Yxmn5YYUvx7Ji5FVfTa2heSJRc7ZYByS4Z3gMB8ca101A8tcWuOeVc= 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=WRMvQbwh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=yxR8s+o0; 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="WRMvQbwh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yxR8s+o0" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751994; 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=lPFQmOLrJY7Wod6zKIr9KTO2ridC0Dt/GDqBloeipRw=; b=WRMvQbwhNpVbf3lhgP+ghTYmjLOtIBiCOT2/zVAjqwrW0ZwtzmMfADVV+u95Lmd4a9n/9R 96et1kCGdYWUveBHbUxg3EI8uQNrvt5nXzzysNqsBL2meDVCyu498G5T07nKFP/P8ZQNXj W3Afpz2uWYkZE3s7Mk50b/z/CVYrOyGX4tO8IDwCNOT1WpNdHtdECkLLPgG6nRJrQ2QAlq AkdNsLigm7winYg6Bl2HHWfRe3qgb7g65/MyPJUmx6JX3HtvDk1g0x8dsqz+x8UooNZRXD OtKiGRse7Od7th7iajyyZhBivdkgCl8/HB7iWF/JeoRU1G/THXCuK6jhQPoGDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751994; 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=lPFQmOLrJY7Wod6zKIr9KTO2ridC0Dt/GDqBloeipRw=; b=yxR8s+o0BVP8XUqjgeXS0yTPQ31Y9/7nIUP6NWWJcjVRSDDUpPPbY3aX7lIuXBgaMDHZPe cGdENvNaBrLnk8AA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH v2 25/31] block, bfq: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:09 +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. Signed-off-by: Nam Cao Cc: Jens Axboe --- block/bfq-iosched.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 167542201603..abd80dc13562 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -7315,9 +7315,8 @@ static int bfq_init_queue(struct request_queue *q, st= ruct elevator_type *e) =20 INIT_LIST_HEAD(&bfqd->dispatch); =20 - hrtimer_init(&bfqd->idle_slice_timer, CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - bfqd->idle_slice_timer.function =3D bfq_idle_slice_timer; + hrtimer_setup(&bfqd->idle_slice_timer, bfq_idle_slice_timer, CLOCK_MONOTO= NIC, + HRTIMER_MODE_REL); =20 bfqd->queue_weights_tree =3D RB_ROOT_CACHED; #ifdef CONFIG_BFQ_GROUP_IOSCHED --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 A023222DFA8 for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=ptLIa5OI9IRZTiCTXs2fIax6JFk8m2xF92wl5zSa/SSwu7dwzEe65E2hG6RYeza2I7BejPkq+lE2A/cBkjF7P5u01obNzVMafvMx+8OGXtB/h3Ylq4QbJ6hHLbfUJLTmapx9e+1DdWQ+eo4uWPG2ch0stOqqVFe/xvwRbRo7ZlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=vvk9VgHZ5HgTwbdh4w7mEa7Iljw0JHLYk31avvHA5NI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UhFiDVEBJkYvMQ1EMFuatdlNsEpmphogUfSxGTHKmLsvZOn9N+gXgNbQA33a5edn+duBRdVTXBqE/bGNKTsUDDUNfCzDhCBRD161SQVvL2b9eTGnM8AKSHS9NirtdW1SDMvddhDFmZiRYDTfmRm8lAFLriFXp9rLp5XLw2uvbwU= 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=O+yQWMvh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bw47NZnk; 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="O+yQWMvh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bw47NZnk" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751994; 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=s39lbmV2IXqF2ss/8vs1KZOHzfRVzb/SaOq7s58i3mc=; b=O+yQWMvhMWYn5XxbAjJNuTHxrxIjoUWETvelT45kKoeizs2cSvMgisooNZZ+JnDF4dAGn5 tKhoQUrNF0/OlkZtMI6MYW/lpBPLPJnIbwNKn/eNlYCX+QoUKb7FNnRHQ37H8/S6plftZ8 stM/zO56Skv8OdzAxMLxpd2ZoMw+LCL+dIAz7RdfIzlDYxSL4PRGB9URiHphHWWxWODGpC iTzOW8n5waU8W5/9eFYe3Ia/qkytsCaTSCcQmiDvi3TURw9QvmJ1troldY2mFs2ksB/PQ/ KBJ6zSJsWb+z+YahWdoQ6Kh8yJPjfGMj0qJ25umR7xK+ZCfEcC1ZFwAFyv3FMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751994; 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=s39lbmV2IXqF2ss/8vs1KZOHzfRVzb/SaOq7s58i3mc=; b=bw47NZnkmnMHbrO7cDbrVtX4bBWx06kLO2Tscn4FulxgsQSsnOGbIM+N6H2nKkSDfjBZ5o Dum7Nt30a/RaaQCw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Damien Le Moal Subject: [PATCH v2 26/31] ata: pata_octeon_cf: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:10 +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: Damien Le Moal Signed-off-by: Nam Cao --- drivers/ata/pata_octeon_cf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c index dce24806a052..2d32125c16fd 100644 --- a/drivers/ata/pata_octeon_cf.c +++ b/drivers/ata/pata_octeon_cf.c @@ -935,9 +935,8 @@ static int octeon_cf_probe(struct platform_device *pdev) ap->mwdma_mask =3D enable_dma ? ATA_MWDMA4 : 0; =20 /* True IDE mode needs a timer to poll for not-busy. */ - hrtimer_init(&cf_port->delayed_finish, CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - cf_port->delayed_finish.function =3D octeon_cf_delayed_finish; + hrtimer_setup(&cf_port->delayed_finish, octeon_cf_delayed_finish, CLOCK_= MONOTONIC, + HRTIMER_MODE_REL); } else { /* 16 bit but not True IDE */ base =3D cs0 + 0x800; --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 A5A5722DFAD for ; Wed, 5 Feb 2025 10:39:56 +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=1738751999; cv=none; b=rQwcQ/qohkF0OSbQ3c1P6VpI+nOnKoK3M9uyNLnu9wEGodbQonso9hvH9/5WxbPatUzQkA0JG57j9dKbvh1Gs5xo4qpC9SeVLkwdqMx3EJrph1a525Q/uloiJJacK2SNPCqobV8OVbme3DcMWoJJt3MEbRqd4bMN/zBz+srDOuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=umj4jcpv/MLsNTN8pIO0bwuiPCTcD0wPH4TbqZTwuEc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M9PxG1Y/vy86YN89hnM7UGTuxvwEAXgLJ9fF/pv4DX74emq758YsVfP1qOHyNABL/Kk3NAtLBdgVv58l8cGK/jwn1SSnbJ8Ge0rHTZAj0/APWWPgKczaaiIudut2MT7sjzF2QXIswMmqWis1pyHJO6zfOFXjC1C+aqWwa3iIU3E= 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=efG+0M74; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sFMCbW54; 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="efG+0M74"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sFMCbW54" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751995; 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=xKM/bZYQdTtqH4O/ElpgLxsoHAAVdtMhyNG3BFK3cuY=; b=efG+0M743tbmHcUi/oFcmIVsvXUibuy2ehBXg+Ea5HoIh3e84pLOa3ex4KofVXkCbrEZx3 CM5EXfKfocQ99QyxxcCO71Cxt4S9OamjnfmYuqC0IxvszHlJjk53rKVeP1QplO5uzZ2NEJ PmWS4kn9r4C7qopHCyxE+aJ07DEAkLFasZaRWENYKEvMbJn4sN6zRPvZZpk/+BISADUFWa 6mEMmh71fm44/fHZyzunOxHQ0Sbhr1QF8v5Ai5JgAuuItB6kmApu/cxeHk+yIzaG3yx0RZ kcRiAvGNRF/bqM4qKP2baKZdWc6h5MwV3gHoBLWLa6C+ILvpvjzhaRScTvLfEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751995; 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=xKM/bZYQdTtqH4O/ElpgLxsoHAAVdtMhyNG3BFK3cuY=; b=sFMCbW54tZHNGR+Wk6V7lpMyw+wiKiVmp4LvgT24txMIhk+hPbTM8oGNhzrdZ6tduNF35D ZkNofqdtmjX+ElAw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH v2 27/31] blk_iocost: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:11 +0100 Message-Id: <196d487c925411923a2d59d4bf5e366b9dac2747.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Jens Axboe --- block/blk-iocost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 65a1d4427ccf..ed11438eb4be 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3004,8 +3004,7 @@ static void ioc_pd_init(struct blkg_policy_data *pd) iocg->hweight_inuse =3D WEIGHT_ONE; =20 init_waitqueue_head(&iocg->waitq); - hrtimer_init(&iocg->waitq_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - iocg->waitq_timer.function =3D iocg_waitq_timer_fn; + hrtimer_setup(&iocg->waitq_timer, iocg_waitq_timer_fn, CLOCK_MONOTONIC, H= RTIMER_MODE_ABS); =20 iocg->level =3D blkg->blkcg->css.cgroup->level; =20 --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 5FC7022B5A1 for ; Wed, 5 Feb 2025 10:39:57 +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=1738751999; cv=none; b=GtMYIRVlUOpzwttrIItlplU3au7eM3Qa1uGBckYx+1mbZljQZyCay79AZJ8bQ9TYDbb/2BEplZ8MqahLHp6N5aKSnffJlNq6tf2BwzJ4h87YDoLrx1/wnJLDeIwWO+qTUXN2Nby7RdmCI59brO9jXgljKzc/VvgWMB35pUCGYYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738751999; c=relaxed/simple; bh=WDk3Pj+/QXFG7eK+JJZpo2nBVqSOunm3oDETZwEO9s4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sFHd/iEP9HK6ciogWFAetvGhPXvW/BKToE34SXHifqwCIUDwPYpL68dpsH/6Thu1MB74bj8ri2vHuTMCs2ZOh7XeEvYmcUZX9WOTL4FTDKCcQieBCe0iznBV2Fg+5kzpc19ooztw7tqRwU48zx/J4KP32tJ3NB+v36KIj1078CQ= 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=BnJzlwd2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zDxii+3z; 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="BnJzlwd2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zDxii+3z" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751995; 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=aOiqioWOP7P055aeqZ3YUvgPYLoNFmwmd1hHdXSmsdU=; b=BnJzlwd2TB28sdTyxrbWEY595gfcSSZZFp/8SLx4//x5oT503vtOIfeRNCmWNPlZ3GpyV7 8VVXzEc2aRRRQGAz/sWdu2AgHNytDo8DWqBgdr4lY4EfgxWKoQAHn/1a8ITxKORafvHOMp dU3ww3NLUO60p173pwzY9snz3JJo8ufuBL0alOXj/cF9SQCBB4+i5xn4ivipUBeOddbtG6 cwj98d9AMH0kLDV/Ed32rzn8MsABb0clIAWXAM8Kfl6i66IdOeFjHxXtg6ZDeVu6M647mR JPH7Q0qoJlEpIYlHkwZhrBateu3EPhP7bjXS0wtiA9soZKDwTSvDZ2jh1ZIoJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751995; 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=aOiqioWOP7P055aeqZ3YUvgPYLoNFmwmd1hHdXSmsdU=; b=zDxii+3zGTvSzG2f6YZhpsameWO9IcOOoxEBpP/KdUXqR6zITCCbP7JA4BC2KNc4T3dByO B45xEeetD88sXrCw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , "Rafael J . Wysocki" Subject: [PATCH v2 28/31] PM: runtime: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:12 +0100 Message-Id: <8d1ce108b043896733ce08d3deea6e84941d499b.1738746821.git.namcao@linutronix.de> 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 Signed-off-by: Nam Cao --- drivers/base/power/runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 2ee45841486b..425c43b2d478 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1764,8 +1764,8 @@ void pm_runtime_init(struct device *dev) INIT_WORK(&dev->power.work, pm_runtime_work); =20 dev->power.timer_expires =3D 0; - hrtimer_init(&dev->power.suspend_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS= ); - dev->power.suspend_timer.function =3D pm_suspend_timer_fn; + hrtimer_setup(&dev->power.suspend_timer, pm_suspend_timer_fn, CLOCK_MONOT= ONIC, + HRTIMER_MODE_ABS); =20 init_waitqueue_head(&dev->power.wait_queue); } --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 E63F122E402 for ; Wed, 5 Feb 2025 10:39:57 +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=1738752000; cv=none; b=s1pCH4w+X3leuceDPnF9jopo/x2iQAx1Ya9Ro8jNPVMY9mXODeRJ2SExV/0Z4zNoEFUeuvq1KrwpMv/XnBkRz4jCWk+1hrrum6b2SKG6oDsrmhXdrKq9jI614uYsUOwx3mJeyhvvAL8rszrMq7yl+nykDLGvPnIENwnGPmjHwS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752000; c=relaxed/simple; bh=YP9HS0ptIzTEGC5ngli3p573WBUnzavxzSb8qjuKIEI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N9QkNMQE7hb52VTEacGXepFlHiuwEAysdqIie6Vqn3L08WYQ3yZI0+I0Lb6lPPgOzkrzTZU4PS8WCim901CNlRXKVN/uGXsuZHoc8bI7k9nF9o1BmUgkrEAtTnOXX/quisDJmeOUOI6WLNlkscwWC/mT09VOSdzeBJY8kW8201E= 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=uGkGTQUF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=N9i+7Fb6; 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="uGkGTQUF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N9i+7Fb6" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751995; 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=qQNxZsLOvb0JOc8RLLPe5wcuFpbkYljvCLJQYULWDzI=; b=uGkGTQUFiSa/ABsiW/ub6veZTFhC+yBmIu674/3K4X5iklWfhvHoQ7QgEZKi2yna5BBkid gAve7/gFdp7gOQUPsFkNY4I0TE3DRKd+fCeoyQ695fzkz2L+ds4/ejNHBhGhWXgIc+wOYR HIsPBKzyFMHnnZVpLY3VajZv0aRDJm1ycCZsr4j+b28m3xYcKsXveS/QD0O6nOapCMqBBU T4vOja83JK3CHa8neN1+5kM5/eG2SWaSsxWh1OMGF152pC9OiRmWN2UZSFbBI4c0Tqrgf+ DGLcu+u3GblgCgE69oOp3nljlI3KPruSI1Q6VCaY4F9zBGY5ybcEFXpwkMs7bw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751995; 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=qQNxZsLOvb0JOc8RLLPe5wcuFpbkYljvCLJQYULWDzI=; b=N9i+7Fb6fXh97OOlAqu6latl06ZW0/D1xpoRgHa9qQF4TFtXSJAlGhvBMfINhQFGVgWoKf 6j6uBFvrcvXSPKCA== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Chanwoo Choi , Heiko Stuebner Subject: [PATCH v2 29/31] PM / devfreq: rockchip-dfi: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:13 +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: Chanwoo Choi Signed-off-by: Nam Cao Cc: Heiko Stuebner --- drivers/devfreq/event/rockchip-dfi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/r= ockchip-dfi.c index e2a1e4463b6f..0470d7c175f4 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -642,8 +642,7 @@ static int rockchip_ddr_perf_init(struct rockchip_dfi *= dfi) if (ret) return ret; =20 - hrtimer_init(&dfi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - dfi->timer.function =3D rockchip_dfi_timer; + hrtimer_setup(&dfi->timer, rockchip_dfi_timer, CLOCK_MONOTONIC, HRTIMER_M= ODE_REL); =20 switch (dfi->ddr_type) { case ROCKCHIP_DDRTYPE_LPDDR2: --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 E423822E3FF for ; Wed, 5 Feb 2025 10:39:57 +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=1738752000; cv=none; b=rgC2vVkMKhDxbAZYjPftkEnqGfoG9FvThxextP/Ny5ctfsBdI7RXeSYxK6lqu/FdRqnc1l8nfqg0hvxD5DNl4ZNXLcfasawIHJXxktO4euaSjAq2ulfTj5w9PESXmGGOxbTKabhYUXlM86RPRCi35NcPwVZJoHpbX/colHycb5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752000; c=relaxed/simple; bh=CD7JvKo/feB52a2k7onyk2ZXeiDetB/mc/twv3Gful4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SkBj5lK/WPSdEa3z0lrpzkGdkyxvwYwPmpV5sRqlQOl8Ysz6XytmYKZ/6Wk5FQlYsR4xNjtYpIlT+KzH2Cme6efD/egjhngHtr273vYJa6YkOb/B+sOPIZUnIXpfkiVfopISywc0pjxFvWDXUliGjMMZYOFt0TvBMq7bYzHf9/4= 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=Cpd85kTn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vNo89CPa; 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="Cpd85kTn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vNo89CPa" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751996; 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=RNi7JDw+w/JQ3w0yvP3N7fB6jIxc2MjvZRk3TGcbngQ=; b=Cpd85kTnp1kCHBi27nxXAiMoXt5qnwclR4ccrDA73hLMS1BTLfTkd0RxuMzgZDKMMYdoBM 0FgABll7/Nhc/TYygXgTKymSghoBbWHe7eQOpmsxx0l2dFMpMy6/g8qUTcRXr9MR4s765Q X/Qzpc1hMgz83XRzRaqCpR6Wumx1YIJaMBLb7Rn9BgdZOFhhuBxJxyLywvOaFzKBawr6Zx haMzm3+0noJeQyLVjW+oM/Se3lAkH1oXa92b7dxjsbJrmftE54KhZAh3nxhbqhV+druViA jr6O051RSJL3tqse82aTZ948aSxwL+n/cst+8itCvAOX3Nit4hFI5Qa9+/sxQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751996; 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=RNi7JDw+w/JQ3w0yvP3N7fB6jIxc2MjvZRk3TGcbngQ=; b=vNo89CPagS07Sf3WO7/kYI4AwXEarpbCOmx34Rf1isREE5I1L+bXeMPqCI9BjFJ6qsHzwz kjt5iJvmFhaE67Cw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Jens Axboe Subject: [PATCH v2 30/31] null_blk: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:14 +0100 Message-Id: <076cd30acb4b2d6b699f3c80463a8983530d4f06.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Jens Axboe --- drivers/block/null_blk/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index d94ef37480bd..16457330c1bc 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1426,8 +1426,7 @@ static void nullb_setup_bwtimer(struct nullb *nullb) { ktime_t timer_interval =3D ktime_set(0, TIMER_INTERVAL); =20 - hrtimer_init(&nullb->bw_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - nullb->bw_timer.function =3D nullb_bwtimer_fn; + hrtimer_setup(&nullb->bw_timer, nullb_bwtimer_fn, CLOCK_MONOTONIC, HRTIME= R_MODE_REL); atomic_long_set(&nullb->cur_bytes, mb_per_tick(nullb->dev->mbps)); hrtimer_start(&nullb->bw_timer, timer_interval, HRTIMER_MODE_REL); } @@ -1604,8 +1603,8 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ct= x *hctx, might_sleep_if(hctx->flags & BLK_MQ_F_BLOCKING); =20 if (!is_poll && nq->dev->irqmode =3D=3D NULL_IRQ_TIMER) { - hrtimer_init(&cmd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - cmd->timer.function =3D null_cmd_timer_expired; + hrtimer_setup(&cmd->timer, null_cmd_timer_expired, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); } cmd->error =3D BLK_STS_OK; cmd->nq =3D nq; --=20 2.39.5 From nobody Sun Dec 14 21:31:08 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 5D0EA22E413 for ; Wed, 5 Feb 2025 10:39:58 +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=1738752000; cv=none; b=QSkmTqTQcQjZa7vWs0zrzCaeqBAO+eaiBjfN5tMb5S6MSVuoNuuPEY2QBJ32ObL/Ps5cphikwuQWbxGqT/dUZx/qrnMaG3/mBkmU9k9VL+IqzJlnMuzVcnLGEVYn3xsPnxGygDecPv3XoChQlVKwH90ygg/U3Gdj6bw7c/Ocogg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738752000; c=relaxed/simple; bh=bYsHlKikMLRNHtZBFjXoHsPnWT52wEwdSd4/ICUqqxo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=t0ZpKnZFkqQBXaWk1nS5rEzFXG9CCVyBrgX7oEbjtAhsoVreUbWPQkBPLNi7mSWtQCNs5l6FB7LPXiwmVxG/q+KNtokwmjhQ3896z7fCGXrthuifTVq6jj9+uBSqgFyGdvTJ2M2uaHoZdOBABccIkQ22A4O0RadzpW6CpHpjFwE= 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=BygJ3IwK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bFZTKcbo; 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="BygJ3IwK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bFZTKcbo" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738751996; 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=YlZUudkxKiwKydn8CFoyh2y5DXuLVq+t1A6J7dtmCaw=; b=BygJ3IwKwe8gthDEq7WjtOwOOkk9dR25Zh+VWxtxNN+dbu29p45J4CGnH/mwwkCbZ+v4es AsUUVcynQZCCyshiRMn03+xovBVyXtB6s+EeaPE2vD0N/n8Xj4lzejWu4VH+7G4EKgWqkX PZcKMThnS638KXxpf0q37UaUdA7TfXdWNU1STf66+vgDNWLEiWWGoLeaXdbr+UNgSM+x2c nZlwJdndOQmzteQdOFyGfuxM3t3NIrnjwn8Cj9dt0W9RxtGn81KmbrxJ4JBjWTfX/hQQck G7aENp4Art76+hoPB/Yi94m0PU1P3IYRowGdIDFRRUOiLK0z6qZ2pnnz0hrc1g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738751996; 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=YlZUudkxKiwKydn8CFoyh2y5DXuLVq+t1A6J7dtmCaw=; b=bFZTKcbonLLW8IGR0gMhPAny4+GE+mLbk7v0z0i6xWas9isxJq9digdcggHBs7qG54AucQ piC5EePY6rCcHMDQ== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Nam Cao , Herbert Xu Subject: [PATCH v2 31/31] hwrng: timeriomem: Switch to use hrtimer_setup() Date: Wed, 5 Feb 2025 11:39:15 +0100 Message-Id: <010640f1668d40894a1721037c56f7a684dbcc5f.1738746821.git.namcao@linutronix.de> 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. Signed-off-by: Nam Cao Cc: Herbert Xu --- drivers/char/hw_random/timeriomem-rng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_rand= om/timeriomem-rng.c index 7174bfccc7b3..b95f6d0f17ed 100644 --- a/drivers/char/hw_random/timeriomem-rng.c +++ b/drivers/char/hw_random/timeriomem-rng.c @@ -152,8 +152,7 @@ static int timeriomem_rng_probe(struct platform_device = *pdev) =20 priv->period =3D ns_to_ktime(period * NSEC_PER_USEC); init_completion(&priv->completion); - hrtimer_init(&priv->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - priv->timer.function =3D timeriomem_rng_trigger; + hrtimer_setup(&priv->timer, timeriomem_rng_trigger, CLOCK_MONOTONIC, HRTI= MER_MODE_ABS); =20 priv->rng_ops.name =3D dev_name(&pdev->dev); priv->rng_ops.read =3D timeriomem_rng_read; --=20 2.39.5