From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbdJEMwW (ORCPT ); Thu, 5 Oct 2017 08:52:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:56709 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751310AbdJEMwV (ORCPT ); Thu, 5 Oct 2017 08:52:21 -0400 Date: Thu, 5 Oct 2017 14:52:19 +0200 (CEST) From: Michael Matz To: Borislav Petkov cc: Mathias Krause , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86-ml , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] x86/alternatives: Fix alt_max_short macro to really be a max() In-Reply-To: <20171005123906.n362s66dve3xplqm@pd.tnic> Message-ID: References: <1507140492-7832-1-git-send-email-minipli@googlemail.com> <20171005073809.depam2y4vw2mb5ya@pd.tnic> <20171005123906.n362s66dve3xplqm@pd.tnic> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 5 Oct 2017, Borislav Petkov wrote: > On Thu, Oct 05, 2017 at 02:35:33PM +0200, Mathias Krause wrote: > > Note the "<"! ...comment is wrong, though the implementation works! > > I know, I realized that when I looked at alternative-asm.h. Wanted to > double-check it with Micha first. Yeah, for bit-twiddling the result of arithmetic would need to be booleanized first, or alternatively the boolean operators be used in the first place. So if '<' works then that's better in this context. (In a different context, or in the same one there definitely was a problem with using '<', but I can't remember the details, it's too long ago we discussed about this; maybe it even was a problem only with some binutils versions. So I'd suggest using the more obvious way until problems reoccur, and then document why exactly using relational ops was a problem ;-) ) Ciao, Michael.