Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3416947pxx; Mon, 2 Nov 2020 08:19:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZeoYe+UrrcNti3acSMZk/1oqxAePOKJKcePZ8jVNkuRfj7Bya+Y7rpy5ATyJyQQFEnr4j X-Received: by 2002:a05:6402:1a33:: with SMTP id be19mr12613638edb.47.1604333978910; Mon, 02 Nov 2020 08:19:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604333978; cv=none; d=google.com; s=arc-20160816; b=L2U+utyri5z/vQr3n76zM0WsVxGvFeAseuewlcIxeU/1IcV3Tg1xqdO0l1lpH8GRQY T9xNPaQSyC9SkxqpnWdCUNo4If4fKHTRb4Z5FVbN/TKnQiMBYixTv3yHfmZmi1x4jJFg 63pOeQREg1biGANaL+Ji3TRp3jxhoEuh+IvqJnsQaYisFMwKVolWon2+Bh/oTyJBDKKP s2dGWzMlg0AREKFCVjkR4oa8J+CpNWTi9DbBoAIFNw7KEEEVCTAAbAG/eRqUh8m7cQnk m0dxIfZgF8Xwugi1dU2Bpt9jM5zB/IJdJrl5ZFTZllB7Ct0LVBQT8smUwSljTWwAvpX5 yn4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=5ebmZkZ6EssFRGEyPn1Qc4ealUOtSh6Bj6ocigTKgzA=; b=IQibMZ/1FKSmWf5EdM9del1RqlgzVk4VelpYW1qcThCbcIuULDqslmIW3SNTdhuUyA nwQtk33gnoRoe1b6g2AGfIQABUSOzbSr4fhTu3sNDoknTtffI8T7Y/Ym/f2No76j5h/A idAn3FbobaidKQKbLjYqMrtajq7hhGGTH4xEO93WEufa/YceFczfaoQ4JxRtJQx6J3pw f8ZM6huT20RVNFwsjRoG6eSAQNT/6UpmZ85VyTY6198PTZMQCH23kv0JDIEhpTVPu5cj kLTRbtW0n0QZyXaQb5MrpFAyffyE5ciuRvwT/ERyECrG4Nzlo0+muyQPNzet9RUpCMM9 sLHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=R0UgwtL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si11098713edk.97.2020.11.02.08.19.00; Mon, 02 Nov 2020 08:19:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=R0UgwtL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbgKBQR1 (ORCPT + 99 others); Mon, 2 Nov 2020 11:17:27 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:52182 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgKBQR0 (ORCPT ); Mon, 2 Nov 2020 11:17:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1604333845; x=1635869845; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=5ebmZkZ6EssFRGEyPn1Qc4ealUOtSh6Bj6ocigTKgzA=; b=R0UgwtL5Dva0sSmDYtQ1Xai5HY0lrg+1U70NAS8Q2f4bAVbfGi+GSgy0 OikazPFTly3a3stOeFvUMDyDKAxeRZWlW9NCUhsGLvKJznlTvgW/fBMoH kC6x51zOgC8Ugwwk5K8gMcNRkunKe0KLy6PCi4jUgmwv7lSQl1QXTgC30 w=; X-IronPort-AV: E=Sophos;i="5.77,445,1596499200"; d="scan'208";a="89754479" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-98acfc19.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 02 Nov 2020 16:17:01 +0000 Received: from EX13MTAUWC002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1d-98acfc19.us-east-1.amazon.com (Postfix) with ESMTPS id 52CA9A1DFF; Mon, 2 Nov 2020 16:16:59 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Nov 2020 16:16:58 +0000 Received: from Alexanders-MacBook-Air.local (10.43.160.22) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Nov 2020 16:16:53 +0000 Subject: Re: [PATCH v1] nitro_enclaves: Fixup type of the poll result assigned value To: Andra Paraschiv , linux-kernel CC: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , "David Duncan" , Bjoern Doebel , "David Woodhouse" , Frank van der Linden , Greg Kroah-Hartman , Karen Noel , Martin Pohlack , Matt Wilson , Paolo Bonzini , Stefano Garzarella , Stefan Hajnoczi , Stewart Smith , Uwe Dannowski , Vitaly Kuznetsov , kvm , ne-devel-upstream References: <20201014090500.75678-1-andraprs@amazon.com> From: Alexander Graf Message-ID: Date: Mon, 2 Nov 2020 17:16:51 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201014090500.75678-1-andraprs@amazon.com> Content-Language: en-US X-Originating-IP: [10.43.160.22] X-ClientProxiedBy: EX13D35UWC004.ant.amazon.com (10.43.162.180) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.10.20 11:05, Andra Paraschiv wrote: > Update the assigned value of the poll result to be EPOLLHUP instead of > POLLHUP to match the __poll_t type. > = > Signed-off-by: Andra Paraschiv > Reported-by: kernel test robot > --- > drivers/virt/nitro_enclaves/ne_misc_dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nit= ro_enclaves/ne_misc_dev.c > index f06622b48d69..9148566455e8 100644 > --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c > +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c > @@ -1508,7 +1508,7 @@ static __poll_t ne_enclave_poll(struct file *file, = poll_table *wait) > if (!ne_enclave->has_event) > return mask; > = > - mask =3D POLLHUP; > + mask =3D EPOLLHUP; That whole function looks a bit ... convoluted? How about this? I guess = you could trim it down even further, but this looks quite readable to me: diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c = b/drivers/virt/nitro_enclaves/ne_misc_dev.c index f06622b48d69..5b7f45e2eb4c 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -1505,10 +1505,8 @@ static __poll_t ne_enclave_poll(struct file = *file, poll_table *wait) poll_wait(file, &ne_enclave->eventq, wait); - if (!ne_enclave->has_event) - return mask; - - mask =3D POLLHUP; + if (ne_enclave->has_event) + mask |=3D POLLHUP; return mask; } Alex Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879