Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3469803pxx; Mon, 2 Nov 2020 09:40:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYVnkJ7YSMCQnFI73oyXGrlr+z3Lx+8Ju0G+9GQCZPtVdeQEUNbW7g8CjSyBy7RZZ86Hpq X-Received: by 2002:a50:e789:: with SMTP id b9mr17489353edn.272.1604338835329; Mon, 02 Nov 2020 09:40:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604338835; cv=none; d=google.com; s=arc-20160816; b=OyxAhmNWsebcIX/+ndCC0P6kgjYDkvHVCxkWwsWaAUCZfbXGyr2CAGu3G0BM7ROVgf 1qid6ZWLpCehJGf9thJ4buNcCXDN6RJeoxGE5wcQjqqqbsyT6oQwwxzOfHdoPJbFTJRX KxNyCdX2yP2PLlTTCrVMLFktDGUFKVfjuo9iia7i6susWPWQQN6R0sjsDar4rCAl1R33 S7Rkk9Ci6ZturjVp81/qK2gyOUGYoG90G466YMjkrr93KWB4sLvy7reghKhjRlP53s9T 2CFozxawAt+TVLUerfhk3oQyRHIye7XLIn8IuTLRUMwm/33aDpQg5Twr0yST4WtGnOgI MJDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=63PIJXKLFwrFkRjowWo20b8DPKycpZ23Q/BMc+ghSfk=; b=dr2NU27m1IoJD8Tg7ZCGvVotFKIm86NhpSWGUcfagtCsCa95OmL4Q7hmCk4xfBF4IF qKdmwf5VzBzorr9mb7VGklbMi+P7oIHs2k99fv9OZjFkttUz0KFsODGPeKaF2Deolc/Z G5m1GMX0KIdl+jc2qXTRIqRfmiG6iGGNRUodNOIpsC+SGNPLWeiTcUJeDupz6rcSppHI Yh++NcvUTgVqRUHcNHgSuwcH/EfO/JiQYw5+pKcR+fX+COFvTJbA8x9PgLIOw/eAX12n zSQLUrqc5sRzn8MZllwEC5PALCmQtqmGarfpK99n0pzAlNswHfw4jIHF1MEEHmgtZzw8 TiyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=X694F9Aq; 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.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si6997251ejf.165.2020.11.02.09.40.12; Mon, 02 Nov 2020 09:40:35 -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.com header.s=amazon201209 header.b=X694F9Aq; 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.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbgKBRgq (ORCPT + 99 others); Mon, 2 Nov 2020 12:36:46 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:5473 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbgKBRgq (ORCPT ); Mon, 2 Nov 2020 12:36:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1604338605; x=1635874605; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=63PIJXKLFwrFkRjowWo20b8DPKycpZ23Q/BMc+ghSfk=; b=X694F9AqmVjeRErGig164uYjTV3JWrVduqTWXdEHKtiKOBesHF4yQ/pF fsMLPkHmNUHi/VViVzhoWHM5nnAXQ/M+q36ZknxvYvL/vxClYEmuPj7pX 5V5xZ82koqslXRVCxC/6h2/GEk32K9kGoSFWX5kOPCakSwiiteZCUdKJH c=; X-IronPort-AV: E=Sophos;i="5.77,445,1596499200"; d="scan'208";a="62248451" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 02 Nov 2020 17:36:38 +0000 Received: from EX13D16EUB003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com (Postfix) with ESMTPS id 0F334A21C2; Mon, 2 Nov 2020 17:36:36 +0000 (UTC) Received: from 38f9d34ed3b1.ant.amazon.com (10.43.160.229) by EX13D16EUB003.ant.amazon.com (10.43.166.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Nov 2020 17:36:27 +0000 From: Andra Paraschiv To: linux-kernel CC: Anthony Liguori , Benjamin Herrenschmidt , Colm MacCarthaigh , "David Duncan" , Bjoern Doebel , "David Woodhouse" , Frank van der Linden , Alexander Graf , 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 , Andra Paraschiv Subject: [PATCH v2] nitro_enclaves: Fixup type and simplify logic of the poll mask setup Date: Mon, 2 Nov 2020 19:36:22 +0200 Message-ID: <20201102173622.32169-1-andraprs@amazon.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 X-Originating-IP: [10.43.160.229] X-ClientProxiedBy: EX13D34UWC002.ant.amazon.com (10.43.162.137) To EX13D16EUB003.ant.amazon.com (10.43.166.99) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the assigned value of the poll result to be EPOLLHUP instead of POLLHUP to match the __poll_t type. While at it, simplify the logic of setting the mask result of the poll function. Changelog v1 -> v2 * Simplify the mask setting logic from the poll function. Signed-off-by: Andra Paraschiv Reported-by: kernel test robot --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index f06622b48d695..f1964ea4b8269 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 = POLLHUP; + if (ne_enclave->has_event) + mask |= EPOLLHUP; return mask; } -- 2.20.1 (Apple Git-117) Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.