lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/alternatives: Fix alt_max_short macro to really be a max()
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@suse.de>

to v2 before sending it.

Thanks!

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2017-10-05 16:56    [W:0.056 / U:2.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site