kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paraschiv, Andra-Irina" <andraprs@amazon.com>
To: Alexander Graf <graf@amazon.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Anthony Liguori <aliguori@amazon.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Colm MacCarthaigh <colmmacc@amazon.com>,
	"David Duncan" <davdunc@amazon.com>,
	Bjoern Doebel <doebel@amazon.de>,
	"David Woodhouse" <dwmw@amazon.co.uk>,
	Frank van der Linden <fllinden@amazon.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Karen Noel <knoel@redhat.com>,
	Martin Pohlack <mpohlack@amazon.de>, Matt Wilson <msw@amazon.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Stewart Smith <trawets@amazon.com>,
	Uwe Dannowski <uwed@amazon.de>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, kvm <kvm@vger.kernel.org>,
	ne-devel-upstream <ne-devel-upstream@amazon.com>
Subject: Re: [PATCH v1] nitro_enclaves: Fixup type of the poll result assigned value
Date: Mon, 2 Nov 2020 19:42:09 +0200	[thread overview]
Message-ID: <1ca4cd54-5ffd-621d-acb1-925bccb06066@amazon.com> (raw)
In-Reply-To: <e4a34429-1b25-00d5-9bf1-045ca49acb8d@amazon.de>



On 02/11/2020 18:16, Alexander Graf wrote:
>
>
> 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 <andraprs@amazon.com>
>> Reported-by: kernel test robot <lkp@intel.com>
>> ---
>>   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/nitro_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 = POLLHUP;
>> +    mask = 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 = POLLHUP;
> +    if (ne_enclave->has_event)
> +        mask |= POLLHUP;
>
>      return mask;
>  }
>

Good point, I updated the logic and sent the v2 of the patch.

https://lore.kernel.org/lkml/20201102173622.32169-1-andraprs@amazon.com/

Thank you.

Andra




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.


      reply	other threads:[~2020-11-02 17:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  9:05 [PATCH v1] nitro_enclaves: Fixup type of the poll result assigned value Andra Paraschiv
2020-11-02 16:16 ` Alexander Graf
2020-11-02 17:42   ` Paraschiv, Andra-Irina [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ca4cd54-5ffd-621d-acb1-925bccb06066@amazon.com \
    --to=andraprs@amazon.com \
    --cc=aliguori@amazon.com \
    --cc=benh@kernel.crashing.org \
    --cc=colmmacc@amazon.com \
    --cc=davdunc@amazon.com \
    --cc=doebel@amazon.de \
    --cc=dwmw@amazon.co.uk \
    --cc=fllinden@amazon.com \
    --cc=graf@amazon.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=knoel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpohlack@amazon.de \
    --cc=msw@amazon.com \
    --cc=ne-devel-upstream@amazon.com \
    --cc=pbonzini@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=trawets@amazon.com \
    --cc=uwed@amazon.de \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).