On Sun, Apr 07, 2019 at 03:54:16PM +0800, Ming Lei wrote: > > OK, will move index check into mp_bvec_advance. > > oops, I recall the above line, because: > > 1) the index check expression is quite straight-forward > > 2) it has been in my todo list to re-use bvec_advance() to re-write > iterate_bvec() > given bvec_advance() is much light-weight than for_each_bvec(). If we > move the index check into bvec_advance(), the helper has to be moved > to bio.h, then we can't use that for iterate_bvec(). You can always create a tiny wrapper around bvec_advance() that sits in bio.h. Which in general is much better style than complex expressions inside of loops inside of macros..