From owner-svn-src-all@freebsd.org Thu Mar 9 08:58:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDBED0488A; Thu, 9 Mar 2017 08:58:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id BFD291924; Thu, 9 Mar 2017 08:58:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 6D1F9103836; Thu, 9 Mar 2017 19:58:32 +1100 (AEDT) Date: Thu, 9 Mar 2017 19:58:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mariusz Zaborski cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314945 - head/sys/boot/i386/libi386 In-Reply-To: <201703090513.v295D8QT061407@repo.freebsd.org> Message-ID: <20170309193117.F1564@besplex.bde.org> References: <201703090513.v295D8QT061407@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=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=HOTiP6MgqpjtSWaEyFsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 08:58:40 -0000 On Thu, 9 Mar 2017, Mariusz Zaborski wrote: > Log: > Some style(9) fixes. No functional changes. > > Submitted by: kczekirda > Sponsored by: Oktawave > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D9395 About half of this is backwards, or just moves the style bugs. > Modified: head/sys/boot/i386/libi386/pxe.c > ============================================================================== > --- head/sys/boot/i386/libi386/pxe.c Thu Mar 9 04:20:00 2017 (r314944) > +++ head/sys/boot/i386/libi386/pxe.c Thu Mar 9 05:13:07 2017 (r314945) > @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); > > /* > * Allocate the PXE buffers statically instead of sticking grimy fingers into > - * BTX's private data area. The scratch buffer is used to send information to > + * BTX's private data area. The scratch buffer is used to send information to > * the PXE BIOS, and the data buffer is used to receive data from the PXE BIOS. > */ Backwards. Sentence breaks are 2 spaces in KNF. > #define PXE_BUFFER_SIZE 0x2000 > @@ -57,11 +57,11 @@ __FBSDID("$FreeBSD$"); > static char scratch_buffer[PXE_BUFFER_SIZE]; > static char data_buffer[PXE_BUFFER_SIZE]; This uses the delicate KNF style of a tab after the type declaration, but not the even more delicate KNF style of another space after that tab except for pointers (the space is to line up the variable names after adding a '*' for pointers), but not the delicate KNF style of a tab after the storage class. This style doesn't work well with complicated and otherwise-verbose declarations. > > -static pxenv_t *pxenv_p = NULL; /* PXENV+ */ > -static pxe_t *pxe_p = NULL; /* !PXE */ > -static BOOTPLAYER bootplayer; /* PXE Cached information. */ > +static pxenv_t *pxenv_p = NULL; /* PXENV+ */ > +static pxe_t *pxe_p = NULL; /* !PXE */ > +static BOOTPLAYER bootplayer; /* PXE Cached information. */ These changes are mostly backwards. 2 of 3 declarations had short type declarations for which the KNF tab worked right. > > -static int pxe_debug = 0; > +static int pxe_debug = 0; > static int pxe_sock = -1; > static int pxe_opens = 0; Nearby declarations still have the tabs. The only clear fix here is changing 1 to plain . There are main other style bugs here. Mostly initializations to 0 or NULL, and only some variables with comments and the comments banal or backwards. > > @@ -72,7 +72,7 @@ static void bangpxe_call(int func); > > static int pxe_init(void); > static int pxe_strategy(void *devdata, int flag, daddr_t dblk, > - size_t size, char *buf, size_t *rsize); > + size_t size, char *buf, size_t *rsize); Backwards. The continuation indentation was originally gnu style (indent -lp). Now it is random tabs, with nothing lining up. KNF uses 4 spaces (indent -ci4), where it is unclear where the spaces start, but it is normal to start them under the function name. > static int pxe_open(struct open_file *f, ...); > static int pxe_close(struct open_file *f); > static int pxe_print(int verbose); Half-KNF with spaces after the storage class and a tab after the type declaration is used fairly consistently. > @@ -84,7 +84,7 @@ static int pxe_netif_match(struct netif > static int pxe_netif_probe(struct netif *nif, void *machdep_hint); > static void pxe_netif_init(struct iodesc *desc, void *machdep_hint); > static int pxe_netif_get(struct iodesc *desc, void *pkt, size_t len, > - time_t timeout); > + time_t timeout); Backwards, as above, except the random tabs give alignment further from gnu style. > @@ -140,8 +140,8 @@ struct devsw pxedisk = { > > /* > * This function is called by the loader to enable PXE support if we > - * are booted by PXE. The passed in pointer is a pointer to the > - * PXENV+ structure. > + * are booted by PXE. The passed in pointer is a pointer to the PXENV+ > + * structure. > */ Declarations are harder to format than statements, so there aren't many more backwards changes, exept most changes to comments are to reverse- style their sentence breaks. > ... > @@ -449,19 +448,19 @@ struct nfs_iodesc { > /* structure truncated here */ > }; > extern struct nfs_iodesc nfs_root_node; > -extern int rpc_port; > +extern int rpc_port; 2 tabs is excessive, and doesn't even line up the variable name with the previous line. > > static void > pxe_rpcmountcall() > { > struct iodesc *d; > - int error; > + int error; Further from KNF. types and names are not indented (by a tab) for local variables in KNF. FreeBSD dropped the bogus rule to indent in the middle of 'struct iodesc' (this rule just makes unrelated names line up), but the above still uses it. The above didn't indent '*d', but it indented 'error' by a tab. Now it has all the old errors, plus an extra tab for 'error'. Bruce