Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272722

Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit in unsync child bitmap

From Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Newsgroups linux.kernel
Subject Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit in unsync child bitmap
Date 2015-11-19 02:00 +0100
Message-ID <qwlJT-2a0-5@gated-at.bofh.it> (permalink)
References <qtYoq-8hK-11@gated-at.bofh.it> <qtYor-8hK-51@gated-at.bofh.it> <qw18u-59k-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit  in unsync child bitmap Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2015-11-18 04:00 +0100
  Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit  in unsync child bitmap Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-19 02:00 +0100
    Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit  in unsync child bitmap Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2015-11-19 04:00 +0100
      Re: [PATCH 02/10] KVM: x86: MMU: Add helper function to clear a bit  in unsync child bitmap Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> - 2015-11-19 05:10 +0100

csiph-web