From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751175AbdBWHZS (ORCPT ); Thu, 23 Feb 2017 02:25:18 -0500 Received: from merlin.infradead.org ([205.233.59.134]:43328 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbdBWHZP (ORCPT ); Thu, 23 Feb 2017 02:25:15 -0500 Date: Thu, 23 Feb 2017 08:24:32 +0100 From: Peter Zijlstra To: Ricardo Neri Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Liang Z Li , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka , Chen Yucong , Alexandre Julliard , Stas Sergeev , Fenghua Yu , "Ravi V. Shankar" , Shuah Khan , linux-kernel@vger.kernel.org, x86@kernel.org, linux-msdos@vger.kernel.org, wine-devel@winehq.org, Adam Buchbinder , Colin Ian King , Lorenzo Stoakes , Qiaowei Ren Subject: Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP Message-ID: <20170223072432.GX6515@twins.programming.kicks-ass.net> References: <20170223063706.71554-1-ricardo.neri-calderon@linux.intel.com> <20170223063706.71554-2-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170223063706.71554-2-ricardo.neri-calderon@linux.intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2017 at 10:36:50PM -0800, Ricardo Neri wrote: > + /* > + * A negative offset generally means a error, except > + * -EDOM, which means that the contents of the register > + * should not be used as index. > + */ > if (indx_offset < 0) > - goto out_err; > + if (indx_offset == -EDOM) > + indx = 0; > + else > + goto out_err; > + else > + indx = regs_get_register(regs, indx_offset); Kernel coding style requires more brackets than are strictly required by C, any block longer than 1 line needs then. Also, if one leg of a conditional needs them, then they should be on both legs. Your code has many such instances, please change them all.