Re: another patch in #for-linus (was Re: [RFC] a corner case of open(2))
From: Pavel Machek
Date: Mon May 02 2016 - 17:49:13 EST
Hi!
> +unsigned long iov_iter_gap_alignment(const struct iov_iter *i)
> +{
> + unsigned long res = 0;
> + size_t size = i->count;
Something is wrong with indentation here.
> + iterate_all_kinds(i, size, v,
> + (res |= (!res ? 0 : (unsigned long)v.iov_base) |
> + (size != v.iov_len ? size : 0), 0),
> + (res |= (!res ? 0 : (unsigned long)v.bv_offset) |
> + (size != v.bv_len ? size : 0)),
> + (res |= (!res ? 0 : (unsigned long)v.iov_base) |
> + (size != v.iov_len ? size : 0))
> + );
Umm. Come on. What's that? Obfuscated C code contest? Could the logic
at least be modified to (res ? ... : 0)?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html