lkml.org 
[lkml]   [2010]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] n_hdlc fix read and write locking
Date
On Tuesday 26 October 2010, Paul Fulghum wrote:
> On 10/25/2010 3:31 PM, Arnd Bergmann wrote:
>
> > Would it be possible to express the same using
> > wait_event_interruptible()?
>
> Yes if I embed an assignment in the event expression:
>
> rc = wait_event_interruptible(&wait, (buf = get_buf()));
> if (!rc)
> process_buf(buf);
>
> Is that considered acceptable?

I'd do it if it makes the code more readable. We need the patch
for the stable release, so it really should be obvious not to
introduce new bugs. I could not fully understand the version
you posted, so if you can make it easier to understand by using
wait_event, please do so. If you think that putting the
assignment into the macro argument outweighs the advantage from
the wait_event, just keep your version.

Arnd


\
 
 \ /
  Last update: 2010-10-26 12:43    [W:0.064 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site