From nobody Mon Nov 25 12:53:14 2024 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 C57E61D959E for ; Mon, 28 Oct 2024 07:35:45 +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=1730100948; cv=none; b=DNY+BSgFBdD4zdZt4DyOEqle8vHoSRr60iR62AnnmRvWst62nhyjQSPKJnSiL2DtgZQmaPBlfDJ0uLULsNehOPh9Ia7QdlqxaJ6zPWNVSomRMe6oE4aR90tB1rMk77PziKUJK7NGLPdjNtW8M4SR4qIFsS21WGH2PdwBX3FQ54E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730100948; c=relaxed/simple; bh=PAgFHu0Asgi4dB6XXNFVWXBQkZak9/WYPuGFM5/xz6k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vEtHF1qqjq9bimLGxFc6PyY9tFDbnr30KGgO+QjCyN9oJDBGC9M1KxPr0ch/XlykMD49iR5im/gHkYWxm6ZYDUSgJqvXC8tHrQ6+VZVawST8FD1Ts8DC72xS6Hth6g/IHdCoe1QmS16QV5tj4N8kpaq9WgdtPw2SSn9cK8+3d3Q= 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=kKlA4hCW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2XRLCu06; 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="kKlA4hCW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2XRLCu06" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730100944; 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=3yfx4w0eTC0A4FJ0ettAAD2eMSeGPaC/JFUMPU2GvCA=; b=kKlA4hCWY4n04CZUrP0qavj3M85fqvpUyVjkxm4dwc+biD8ay2ItRhXUNBOG4z1kj+zWug s+HNrs6WQ0E20f7jY460VWlAJop65+od1DHxnI4K4drXBibS008xLiXJJXZUEGPK1L5Djx pOZ+usGVTQzkAp+3+uqGXuTXSBc1fUPcrnHZoil87G/+1csivqwa5YuT69fG1R2gMPehij TDWi+weYfr0bzGK8RZtIe8HowiWXcHVvv9LZ7OAAiJC9PsvSwpiiiRUe08o/dwoqGlYbzw mgpZZxpm/IENKx8tNF6JyOPjyse2zmEt3WAjV3OoNECJG1mqRiYqLA54Mmi/7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730100944; 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=3yfx4w0eTC0A4FJ0ettAAD2eMSeGPaC/JFUMPU2GvCA=; b=2XRLCu06QnDW2ewnovqTDrfEfrQm4gsiGp0gpMxn2OVqZkhfG5Tpxgp0yQpLL5YhomZoh3 A4+UhVENfh/vAhAw== To: Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Andreas Hindborg , Alice Ryhl , Miguel Ojeda , Kees Cook , linux-kernel@vger.kernel.org Cc: Nam Cao , Jani Nikula Subject: [PATCH 31/44] drm/i915/gvt: Switch to use hrtimer_setup() Date: Mon, 28 Oct 2024 08:35: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" There is a newly introduced hrtimer_setup() which will replace hrtimer_init(). This new function is similar to the old one, except that it also sanity-checks and initializes the timer's callback function. Switch to use this new function. Patch was created by using Coccinelle. Signed-off-by: Nam Cao --- Cc: Jani Nikula --- drivers/gpu/drm/i915/gvt/display.c | 3 +-- drivers/gpu/drm/i915/gvt/sched_policy.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/= display.c index c66d6d3177c8..0e80251d2666 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c @@ -575,8 +575,7 @@ static int setup_virtual_dp_monitor(struct intel_vgpu *= vgpu, int port_num, vgpu->display.port_num =3D port_num; =20 /* Init hrtimer based on default refresh rate */ - hrtimer_init(&vblank_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - vblank_timer->timer.function =3D vblank_timer_fn; + hrtimer_setup(&vblank_timer->timer, vblank_timer_fn, CLOCK_MONOTONIC, HRT= IMER_MODE_ABS); vblank_timer->vrefresh_k =3D port->vrefresh_k; vblank_timer->period =3D DIV64_U64_ROUND_CLOSEST(NSEC_PER_SEC * MSEC_PER_= SEC, vblank_timer->vrefresh_k); =20 diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915= /gvt/sched_policy.c index c077fb4674f0..9f97f743aa71 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c @@ -286,8 +286,7 @@ static int tbs_sched_init(struct intel_gvt *gvt) return -ENOMEM; =20 INIT_LIST_HEAD(&data->lru_runq_head); - hrtimer_init(&data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); - data->timer.function =3D tbs_timer_fn; + hrtimer_setup(&data->timer, tbs_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_A= BS); data->period =3D GVT_DEFAULT_TIME_SLICE; data->gvt =3D gvt; =20 --=20 2.39.5