> > > s = --s >> PAGE_SHIFT;
> >
> > This code has undefined behaviour.
>
> Do you mean that this:
>
> s = (s-1) >> PAGE_SHIFT
>
> is more deterministic? If so, I agree -- if you mean something else,
> I am kind of lost.
I mean that this code violates the rule that you may modify a value
only once between two sequence points. Newer gccs have a warning for
this (-Wsequence-point), the info page tells more.
Also, did I understand it right that you want to use fls even on
architectures that don't have it as a builtin? I would guess that will
actually be noticeably slower, since generic_fls is so complicated.
-- Falk - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/