lkml.org 
[lkml]   [2016]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH 05/14] eeprom: at24: hide the read/write loop behind a macro

> > >> +#define loop_until_timeout(tout, op_time) \
> > >> + for (tout = jiffies + msecs_to_jiffies(write_timeout), \
> > >> + op_time = jiffies; \
> > >> + time_before(op_time, tout); \
> > >> + usleep_range(1000, 1500), op_time = jiffies)

What about:

#define loop_until_timeout(tout, op_time) \
for (tout = jiffies + msecs_to_jiffies(write_timeout), op_time = 0; \
op_time ? time_before(op_time, tout) : true; \
usleep_range(1000, 1500), op_time = jiffies)

? Would probably need an explanation in a comment, though.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-07-16 07:41    [W:0.076 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site