nitro_enclaves: Fixup type of the poll result assigned value
Subsystems (2)
PATCH 1/1 nitro_enclaves: Fixup type of the poll result assigned value
Update the assigned value of the poll result to be EPOLLHUP instead of POLLHUP to match the __poll_t type.
--- drivers/virt/nitro_enclaves/ne_misc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virt/nitro_enclaves/ne_misc_dev.c +1 -1
@@ -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 ;return mask; }
Signature · 6 lines
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.
Quoted 14 lines · Andra Paraschiv
Update the assigned value of the poll result to be EPOLLHUP instead of POLLHUP to match the
__poll_ttype.Signed-off-by Andra Paraschiv <[email protected]>Reported-by kernel test robot <[email protected]>--- drivers/virt/nitro_enclaves/ne_misc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/virt/nitro_enclaves/ne_misc_dev.c +0
-0
drivers/virt/nitro_enclaves/ne_misc_dev.c static __poll_t ne_enclave_poll(struct file *file, poll_table *wait) · line 1511
Quoted 5 lines
drivers/virt/nitro_enclaves/ne_misc_dev.c +1
-1@@ -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:
drivers/virt/nitro_enclaves/ne_misc_dev.c +2 -4
@@ -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; }
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
Quoted 42 lines · Alexander Graf
Quoted 14 lines · Andra Paraschiv
Update the assigned value of the poll result to be EPOLLHUP instead of POLLHUP to match the
__poll_ttype.Signed-off-by Andra Paraschiv <[email protected]>Reported-by kernel test robot <[email protected]>---
drivers/virt/nitro_enclaves/ne_misc_dev.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/virt/nitro_enclaves/ne_misc_dev.c +0
-0drivers/virt/nitro_enclaves/ne_misc_dev.c static __poll_t ne_enclave_poll(struct file · line 1512
Quoted 5 lines
drivers/virt/nitro_enclaves/ne_misc_dev.c +1
-0@@ -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:
drivers/virt/nitro_enclaves/ne_misc_dev.c +2
-4@@ -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;
Quoted 2 lines
}
Good point, I updated the logic and sent the v2 of the patch.
https://lore.kernel.org/lkml/[email protected]/
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.