lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160716045651.GB1677@tetsubishi>
Date:	Sat, 16 Jul 2016 13:56:52 +0900
From:	Wolfram Sang <wsa@...-dreams.de>
To:	Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc:	linux-i2c <linux-i2c@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Lunn <andrew@...n.ch>,
	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	GregKH <greg@...ah.com>
Subject: Re: [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.


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ