From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="a0RMRtdr" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AAFA1B3; Wed, 22 Nov 2023 16:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700699164; x=1732235164; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=kMJqNQrPFkouBUmP1tIxtozSsYheDkR/LnL4F11wiis=; b=a0RMRtdr45SnsHLYk3kiLIfZs2Z292eQtCjDOGkSajq4kJgqoPyPz1Z8 xhWoNH51ino8oe9+Nmimsn7SFdTQgw8cA/qSM06asNrV9XlVmhWFA6efE bx/KJxGEkz9CgKaAcRip2AVvQj244oSCMbQ2SV3R4DIR0CTNKXPPkI00S 8UPzwDbKGWrNEIvyOLU2GF23JoceIic+G88FMkrhNsWS/7MACg0sIjNMf ijDW0ytrIcjGYvd6MSyu2liYjeaUIruC6bgfya5Y7v4Nc28NcFQbnBBQQ f0zW1UCdi/Sb7g9NYp8o9b8iKurHqbTYEdk8doLf35VPgtN8OmhSA3u25 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="389323011" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="asc'?scan'208";a="389323011" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 16:26:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="716903060" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="asc'?scan'208";a="716903060" Received: from debian-skl.sh.intel.com (HELO debian-skl) ([10.239.160.45]) by orsmga003.jf.intel.com with ESMTP; 22 Nov 2023 16:25:45 -0800 Date: Thu, 23 Nov 2023 08:24:24 +0800 From: Zhenyu Wang To: Christian Brauner Cc: linux-fsdevel@vger.kernel.org, Christoph Hellwig , Jan Kara , Vitaly Kuznetsov , Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, David Woodhouse , Paul Durrant , Oded Gabbay , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Zhenyu Wang , Zhi Wang , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Leon Romanovsky , Jason Gunthorpe , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , Eric Farman , Matthew Rosato , Halil Pasic , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Tony Krowiak , Jason Herne , Harald Freudenberger , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Diana Craciun , Alex Williamson , Eric Auger , Fei Li , Benjamin LaHaise , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Kirti Wankhede , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fpga@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-aio@kvack.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Jens Axboe , Pavel Begunkov , io-uring@vger.kernel.org Subject: Re: [PATCH v2 1/4] i915: make inject_virtual_interrupt() void Message-ID: Reply-To: Zhenyu Wang References: <20231122-vfs-eventfd-signal-v2-0-bd549b14ce0c@kernel.org> <20231122-vfs-eventfd-signal-v2-1-bd549b14ce0c@kernel.org> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ehCOKC0wDaVXxQlM" Content-Disposition: inline In-Reply-To: <20231122-vfs-eventfd-signal-v2-1-bd549b14ce0c@kernel.org> --ehCOKC0wDaVXxQlM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023.11.22 13:48:22 +0100, Christian Brauner wrote: > The single caller of inject_virtual_interrupt() ignores the return value > anyway. This allows us to simplify eventfd_signal() in follow-up > patches. >=20 > Signed-off-by: Christian Brauner > --- > drivers/gpu/drm/i915/gvt/interrupt.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/gvt/interrupt.c b/drivers/gpu/drm/i915/= gvt/interrupt.c > index de3f5903d1a7..9665876b4b13 100644 > --- a/drivers/gpu/drm/i915/gvt/interrupt.c > +++ b/drivers/gpu/drm/i915/gvt/interrupt.c > @@ -422,7 +422,7 @@ static void init_irq_map(struct intel_gvt_irq *irq) > #define MSI_CAP_DATA(offset) (offset + 8) > #define MSI_CAP_EN 0x1 > =20 > -static int inject_virtual_interrupt(struct intel_vgpu *vgpu) > +static void inject_virtual_interrupt(struct intel_vgpu *vgpu) > { > unsigned long offset =3D vgpu->gvt->device_info.msi_cap_offset; > u16 control, data; > @@ -434,10 +434,10 @@ static int inject_virtual_interrupt(struct intel_vg= pu *vgpu) > =20 > /* Do not generate MSI if MSIEN is disabled */ > if (!(control & MSI_CAP_EN)) > - return 0; > + return; > =20 > if (WARN(control & GENMASK(15, 1), "only support one MSI format\n")) > - return -EINVAL; > + return; > =20 > trace_inject_msi(vgpu->id, addr, data); > =20 > @@ -451,10 +451,10 @@ static int inject_virtual_interrupt(struct intel_vg= pu *vgpu) > * returned and don't inject interrupt into guest. > */ > if (!test_bit(INTEL_VGPU_STATUS_ATTACHED, vgpu->status)) > - return -ESRCH; > - if (vgpu->msi_trigger && eventfd_signal(vgpu->msi_trigger, 1) !=3D 1) > - return -EFAULT; > - return 0; > + return; > + if (!vgpu->msi_trigger) > + return; > + eventfd_signal(vgpu->msi_trigger, 1); > } I think it's a little simpler to write as if (vgpu->msi_trigger) eventfd_signal(vgpu->msi_trigger, 1); Looks fine with me. Reviewed-by: Zhenyu Wang Thanks! > =20 > static void propagate_event(struct intel_gvt_irq *irq, >=20 > --=20 > 2.42.0 >=20 --ehCOKC0wDaVXxQlM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCZV6bswAKCRCxBBozTXgY JySHAJ4qE2jv0i0ZauQv+Bv/bGwHt0ZrbACeJadIIL6gQC6kmoICLhyqplCwOeo= =1+t0 -----END PGP SIGNATURE----- --ehCOKC0wDaVXxQlM--