From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 1/3] KVM: x86 emulator: Fix task switch privilege checks Date: Tue, 24 Jan 2012 12:17:21 +0200 Message-ID: <20120124101721.GO9571@redhat.com> References: <1327335048-31925-1-git-send-email-kwolf@redhat.com> <1327335048-31925-2-git-send-email-kwolf@redhat.com> <20120124095207.GN9571@redhat.com> <4F1E8345.7080901@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, joerg.roedel@amd.com, yoshikawa.takuya@oss.ntt.co.jp, avi@redhat.com, mtosatti@redhat.com To: Kevin Wolf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:27058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754982Ab2AXKR0 (ORCPT ); Tue, 24 Jan 2012 05:17:26 -0500 Content-Disposition: inline In-Reply-To: <4F1E8345.7080901@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 24, 2012 at 11:09:09AM +0100, Kevin Wolf wrote: > >> + } else if (reason != TASK_SWITCH_IRET) { > >> + dpl = next_tss_desc.dpl; > >> } > > No need parentheses around one statement. > > Documentation/CodingStyle says: > > "This does not apply if only one branch of a conditional statement is a > single statement; in the latter case use braces in both branches:" > Then you need to put parentheses around "if (reason != TASK_SWITCH_IRET)" if you want to follow the letter of the CodingStyle :) But I do not see this coding stile part widely used in core kernel code: $ git grep "} else$" kernel | wc -l 122 Can't think of re to check when the rule is followed :( -- Gleb.