lkml.org 
[lkml]   [2023]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] eventfd: use wait_event_interruptible_locked_irq() helper
On Thu, Feb 16, 2023 at 01:29:00PM +0000, Matthew Wilcox wrote:
> On Thu, Feb 16, 2023 at 09:17:39PM +0800, wenyang.linux@foxmail.com wrote:
> > + res = wait_event_interruptible_locked_irq(
> > + ctx->wqh, ULLONG_MAX - ctx->count > ucnt) ?
> > + -ERESTARTSYS : sizeof(ucnt);
>
> You've broken the line here in a weird way. I'd've done it as:
>
> res = wait_event_interruptible_locked_irq(ctx->wqh,
> ULLONG_MAX - ctx->count > ucnt) ?
> -ERESTARTSYS : sizeof(ucnt));
>
> ... also the patch you've sent here doesn't even compile. Have you
> tested it?

Sorry, I misread it. But I would have avoided use of the ?: operator
here ...

res = wait_event_interruptible_locked_irq(ctx->wqh,
ULLONG_MAX - ctx->count > ucnt);
if (res == 0)
res = sizeof(ucnt);

\
 
 \ /
  Last update: 2023-03-27 00:25    [W:0.039 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site