From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v4 01/17] x86/mpx: Do not use SIB index if index points to R/ESP Date: Thu, 23 Feb 2017 08:24:32 +0100 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 Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v5f9CAGLNZWiI7pNbwjMz7NmtBxCcclz3+y43ZAcR9s=; b=O0Tivpk7WDW+d/TewC1yqpGSi jj0Y4hPORSO9aFAxVhf+7n+oDTZOSQmXHHjPz2NN/Y+f6bq8QsV/P2ogmoxqK6iMEtR66+0a58D78 glarQ1LOaVa05tXPOQT6p/YtM+4Nu1H+ahA0tQixFRhxtAPBHdNs5sqdC4ymh9e7W1FSZwaqXDcgu ghPSIUE+Vxx0Li8LpE1S0p1khnYJoEQEN4mFgdlWQwMbhk6NK4ATbQs5yeKSLR9moOL1nL4GxPGTJ JhpQDJi4xxB3+LsJtikMzVc3/B2+EKpZ/zEX72rLhx6VGYD/UEJ4SRuKwWOSM9wQgLJWm8LrXFCwx Content-Disposition: inline In-Reply-To: <20170223063706.71554-2-ricardo.neri-calderon@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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.