Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757536AbbKSA6i (ORCPT ); Wed, 18 Nov 2015 19:58:38 -0500 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:36054 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756350AbbKSA6h (ORCPT ); Wed, 18 Nov 2015 19:58:37 -0500 Subject: Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit in unsync child bitmap To: Xiao Guangrong , pbonzini@redhat.com References: <20151112204849.ba920599a8426d7196a0df73@lab.ntt.co.jp> <20151112205019.611e8216adebb465b689876e@lab.ntt.co.jp> <564BE628.1050705@linux.intel.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Takuya Yoshikawa Message-ID: <564D1EF7.4000707@lab.ntt.co.jp> Date: Thu, 19 Nov 2015 09:59:35 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564BE628.1050705@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 38 On 2015/11/18 11:44, Xiao Guangrong wrote: > On 11/12/2015 07:50 PM, Takuya Yoshikawa wrote: >> + if (!ret) { >> + clear_unsync_child_bit(sp, i); >> + continue; >> + } else if (ret > 0) { >> nr_unsync_leaf += ret; > > Just a single line here, braces are unnecessary. > >> - else >> + } else >> return ret; I know we can eliminate the braces, but that does not mean we should do so: there seems to be no consensus about this style issue and checkpatch accepts both ways. Actually, some people prefer to put braces when one of the if/else-if/else cases has multiple lines. You can see some examples in kernel/sched/core.c: see hrtick_start(), sched_fork(), free_sched_domain(). In our case, I thought putting braces would align the else-if and else and make the code look a bit nicer, but I know this may be just a matter of personal feeling. In short, unless the maintainer, Paolo for this file, has any preference, both ways will be accepted. Takuya -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/