[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251125110448.5ff112ea@gandalf.local.home>
Date: Tue, 25 Nov 2025 11:04:48 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: James Bottomley <James.Bottomley@...senPartnership.com>,
ksummit@...ts.linux.dev, Dan Williams <dan.j.williams@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>, Dan Carpenter
<dan.carpenter@...aro.org>
Subject: Re: Clarifying confusion of our variable placement rules caused by
cleanup.h
On Tue, 25 Nov 2025 17:25:19 +0300
Alexey Dobriyan <adobriyan@...il.com> wrote:
> C89 style provokes substyles(!) which makes adding new variables even
> more obnoxious: some subsystems have(had?) a rule saying that declarations
> (with initializers) must be sorted by length, so not only programmer has
> to PageUp to the beginning of the block, but then aim carefully and
> insert new declaration.
As one of the subsystem maintainers that enforce the "order by length"
rule, I'm also for making more exceptions to the c89 method. The reason we
do the "order by length" is for aesthetic reasons, as nicer looking code is
easier to read. If there's a rule to have all declarations at the top, at
least make it pretty!
But yeah, perhaps if we didn't have a strict enforcement of declaring
everything at the top, we wouldn't have bugs like this:
https://lore.kernel.org/all/20251125032630.8746-3-piliu@redhat.com/
-- Steve
Powered by blists - more mailing lists