Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp17320rdh; Wed, 22 Nov 2023 16:28:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMH9VcZH8wsptm75CmvQySq16pueRyCqyYYXI7iKabE3RmP0IYsfT/Q/CYGKPY5JpuTE1k X-Received: by 2002:a05:6a21:a59b:b0:18b:437f:5f1 with SMTP id gd27-20020a056a21a59b00b0018b437f05f1mr1663394pzc.26.1700699297376; Wed, 22 Nov 2023 16:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700699297; cv=none; d=google.com; s=arc-20160816; b=srbJAWR8ZtCd4AKmVltlZf9Ul8vN0M/gl61U2xLI74nkgdnCsnG/MjPB0sKf5tXKM9 r4ae+kG2a9olat/lUmhMUtqJdCOhsVP76UYSISUfSJkYt07IEaeILM4vKU11OpRBW8v9 EirUEvLMlnwx/DsEs5K+shMI5jw3uKtrdNR4EEfF+yk51Gc1P4wubVaRHN7DljuSWO5z /IW+SAA7OlBc9uohFzwCjbtqazUtHE4xnzRqL7U6Z2V09ceb4ShwymvIbocc42RDJTUG RBrYYl86MxaBtj8j9Rti05M3QfJlh76cpVbxUwlo4Am6krnJ6BV6HGfRhGyHN4BCgTsg WaJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MfeM5pDmGQkU41GtCe3qHTN9EQmixR/daGjlJECpUxY=; fh=o4Dq6GeO+YpuBESu7iIWE8q03XQ/heY11JZf4WM67Zs=; b=sErnBToheUfPX7yt0LVXNFRcmXTaJsNSZ8ITV67mw+76HbxiSh5SQ6LdoP+/kqJlL7 Fl7A6Pn5kGaa4mjouGIG4f4gcx2VhYC/X4EhF72lhjQ56BCcnB7WcyNnDYDYPrZdLnXm 5wsXWBOraEWmQ77v4qUTdGmqKAmu8qNez3YUyfBezSsAESWcWpGa5A5TjylaODgZ8r8l LP5Y5z2MpN4mGTQsKWyRiHEHWLfxglpP6YOeyOSesvpDHK/cOBX2VCl65u9TZUjVy8j0 tK3ZtWhwP9pdpsvbbAMQU1jIggrPdYLZLjJ59G9Jr9TZBbnwIUOMbtzUFpU8fClqT75Y UDhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a0RMRtdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t7-20020a635347000000b005ac2af99d30si191893pgl.705.2023.11.22.16.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 16:28:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a0RMRtdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F142381EE2E6; Wed, 22 Nov 2023 16:28:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbjKWA0J (ORCPT + 99 others); Wed, 22 Nov 2023 19:26:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWA0I (ORCPT ); Wed, 22 Nov 2023 19:26:08 -0500 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> 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> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 16:28:15 -0800 (PST) --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--