Date: Fri, 8 Dec 2017 12:09:47 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Warner Losh <imp@bsdimp.com> Cc: Bruce Evans <brde@optusnet.com.au>, Mark Johnston <markj@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r326658 - head/lib/libefivar Message-ID: <20171208120208.F1461@besplex.bde.org> In-Reply-To: <CANCZdfpMm5iB59xjhwrQFRHyr5KpCEMzXnCn1rmS6uBxVseTRg@mail.gmail.com> References: <201712071516.vB7FGHuT069830@repo.freebsd.org> <20171208093703.Q1048@besplex.bde.org> <CANCZdfpMm5iB59xjhwrQFRHyr5KpCEMzXnCn1rmS6uBxVseTRg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 7 Dec 2017, Warner Losh wrote: > On Thu, Dec 7, 2017 at 3:50 PM, Bruce Evans <brde@optusnet.com.au> wrote: > >> On Thu, 7 Dec 2017, Mark Johnston wrote: >> >> Log: >>> Ensure that "out" is initialized in all error paths. >>> ... >>> Modified: head/lib/libefivar/efivar-dp-xlate.c >>> ============================================================ >>> ================== >>> --- head/lib/libefivar/efivar-dp-xlate.c Thu Dec 7 09:05:34 >>> 2017 (r326657) >>> +++ head/lib/libefivar/efivar-dp-xlate.c Thu Dec 7 15:16:17 >>> 2017 (r326658) >>> @@ -529,7 +529,7 @@ build_dp(const char *efimedia, const char *relpath, ef >>> { >>> char *fp, *dptxt = NULL; >>> int rv = 0; >>> - efidp out; >>> + efidp out = NULL; >>> size_t len; >>> >>> fp = path_to_file_dp(relpath); >>> >> >> This is a worse style of initializations in declararations than usual. >> 1 initialization in a non-declaration is mixed with many initializations >> in declarations, using the C99 misfeature of allowing initialiations >> after statements, without even any blank lines to keep the declarations >> separate. > > This matches the current style of the file though... The rest of the file, and other libefivar files with 1-tab indentation, are not very far from KNF. Some even have a blank line after null declarations. This file even has parentheses around return values in most places. >> Most libefivar code is much uglier than this, with 2-space indentation >> and worse. > > The code you are complaining about is vendor code.... The 2-space > indentation is the least of the issues with that code.... If it were in the vendor tree, then I could not-see it more easily. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171208120208.F1461>