Re: [PATCH] x86/alternatives: Fix alt_max_short macro to really be a max()

From: Borislav Petkov
Date: Thu Oct 05 2017 - 10:55:37 EST


On Thu, Oct 05, 2017 at 02:35:33PM +0200, Mathias Krause wrote:
> Oh, btw., quoting its counter part from arch/x86/include/asm/alternative-asm.h:
>
> /*
> * max without conditionals. Idea adapted from:
> * http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax
> */
> #define alt_max_short(a, b) ((a) ^ (((a) ^ (b)) & -(-((a) < (b)))))
>
> Note the "<"! ...comment is wrong, though the implementation works!

Ok, please fix that comment in alternative-asm.h and add

Reviewed-and-tested-by: Borislav Petkov <bp@xxxxxxx>

to v2 before sending it.

Thanks!

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.