[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/2] CODING_STYLE: list further brace placement exceptions


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 22 Jul 2019 08:14:41 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FmAHMqop5VmDDcjLtjNzHg0Z1qLYAbiRexztSgFJBu8=; b=YiSgAPVVnueB+Qj7OfPm72ACbW4s3yV/wOkG+ZJCEO7W1vwCOLqRrLQWHV3FBL+opTsn+R0KOzFK1CmwvJdnOTVLA6LmRBkbkaQeUXQliafUSor4Pcpo/iMFB9WvwHsqjG7hrQpHNW0GPi+GwcGdcLiOnECoX0ndoTmsGQHdEwC4XShg5ZF4YryAEYUKLjO4WGMG1o0IWcDb56tA5k23kt+xchOU4na3DrigBhu4N34cHlayTRg7pUkwjgDu0qj7LoEnJadXO7utEKjNQXY+8AT0WpageT+IiIFmfRHK4nL78WKQJeRLZcBpvQSqMDhz3dYWII7i7tk7fl/7acPqmg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UmNi2Zr8pXvIHVykh1pVd0YQRYe4RpwDUZWpvvyjIHGNiX/hekmNMU6cja3fhnx39zwiOLBaaBH5gwh/ocaB0zuySlL/Fju86onKbMDyrH0PvFMW63Isgc5a7GtuQQpZGS3/+KpNhelEleXAqBV6B3NlZCo2DN/5tkiY99LgfiJGIn8Bzf885B4JLfA3446xcNZid6k1eOY+J2tjavxET2Gp3luWlqxYa5jqj/4eMqVjyJYbXjAMoc9dkbZTvth/3EUbrVqIM54yjhGETBvi8P3xIDXhTGrKFk5roYjCzcWYbJEgFrIssfmGmYiIZfRNFzrwH0wgPoFzZUZJTQlQOA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: StefanoStabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, AndrewCooper <andrew.cooper3@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, JulienGrall <julien.grall@xxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 22 Jul 2019 08:15:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPhMBr+RUGGWe+UK6rQHc+fBEZKbSJ1KAgAQnhoA=
  • Thread-topic: [Xen-devel] [PATCH 2/2] CODING_STYLE: list further brace placement exceptions

On 19.07.2019 18:48, Volodymyr Babchuk wrote:
> Jan Beulich writes:
>> --- a/CODING_STYLE
>> +++ b/CODING_STYLE
>> @@ -64,8 +64,13 @@ Bracing
>>    -------
>>
>>    Braces ('{' and '}') are usually placed on a line of their own, except
>> -for the do/while loop.  This is unlike the Linux coding style and
>> -unlike K&R.  do/while loops are an exception. e.g.:
>> +for
>> +- the do/while loop
>> +- the opening brace in definitions of enum, struct, and union
>> +- the opening brace in initializers
>> +- compound literals
> Looks like this leaves us only with "if/else", "for", "switch" and
> various forms of "for_each_*". So maybe it is worth to rewrite this
> in the opposite manner? Like this:

That's an option, but I'm not sure I'd want to go that route. Note
also how you don't mention e.g. "asm" and "return".

> Braces ('{' and '}') are usually placed on the same line, except the
> following cases:
> 
>   - if, else, for, switch statements
>   - for_each_* iterators like for_each_vcpu

For the latter I think we want to stick to not mandating style
either way: There's already a fair amount of either of the two
legitimate forms. It's really a matter of personal taste whether
to consider these pseudo-keywords.

>> +This is unlike the Linux coding style and unlike K&R.  do/while loops
> There is extra space before "do/while".

No. In such documents it is quite common to have double blanks
after a full stop. See e.g. the original text, which had two
instances of this.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.