Skip to content

Commit

Permalink
nitro_enclaves: Fixup type and simplify logic of the poll mask setup
Browse files Browse the repository at this point in the history
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.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Andra Paraschiv <andraprs@amazon.com>
Link: https://lore.kernel.org/r/20201102173622.32169-1-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andra Paraschiv authored and Greg Kroah-Hartman committed Nov 9, 2020
1 parent 3ed1cfb commit d9109fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/virt/nitro_enclaves/ne_misc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d9109fe

Please sign in to comment.