From owner-svn-src-head@freebsd.org Wed Feb 20 01:56:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB54614E16BB; Wed, 20 Feb 2019 01:56:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2D98672E; Wed, 20 Feb 2019 01:56:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2C58A432FAD; Wed, 20 Feb 2019 12:56:43 +1100 (AEDT) Date: Wed, 20 Feb 2019 12:56:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tom Jones cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344292 - head/sys/dev/acpica In-Reply-To: <201902191904.x1JJ4qIh036879@repo.freebsd.org> Message-ID: <20190220123807.E1184@besplex.bde.org> References: <201902191904.x1JJ4qIh036879@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=pcXBGyXzM1LMojfo2MEA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 6D2D98672E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 01:56:55 -0000 On Tue, 19 Feb 2019, Tom Jones wrote: > Log: > Fix style after r340832 > > Reported by: jhb > Reviewed by: jhb, jtl > Approved by: jtl (mentor) Unfortunately, acpi (even the FreeBSD dev/acpica part) has a very non-KNF style. It is unclear even what this style is, so it is hard to write changes consistent with it. But it is clear that this style isn't the one one used in the line after the one touched by this commit. > Modified: head/sys/dev/acpica/acpi_battery.c > ============================================================================== > --- head/sys/dev/acpica/acpi_battery.c Tue Feb 19 18:50:20 2019 (r344291) > +++ head/sys/dev/acpica/acpi_battery.c Tue Feb 19 19:04:52 2019 (r344292) > @@ -172,7 +172,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba > * Be sure we can get various info from the battery. > */ > if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || > - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) > continue; > > /* If a battery is not installed, we sometimes get strange values. */ acpica uses 4-column indents, especially in this file, so the 'continue' line is clearly misindented here. acpica's indentation for continued lines is unclear. The KNF 4-column continuation indent works very badly when the main indent is also 4-column. But it is used in similar code (including a 'continue' just 5 lines after here). So it is consistently bad here. Elsewhere, acpica seems to use gnu style (-lp). Here and 5 lines later, that accidentally gives the 4-column indent by lining up with the parentheses of 'if (', A quick look at some other files shows many examples of gnu style (-lp) for long function parameter lists, and many similar regressions towards KNF style. Bruce