From: Dan Carpenter <dan.carpenter@linaro.org>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
ksummit@lists.linux.dev, Dan Williams <dan.j.williams@intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Clarifying confusion of our variable placement rules caused by cleanup.h
Date: Sun, 18 Jan 2026 22:33:42 +0300 [thread overview]
Message-ID: <aW01ludvLz9xNzkd@stanley.mountain> (raw)
In-Reply-To: <d187bc4bb0ff1de7812cc4d1673a55b45cb59d68.camel@HansenPartnership.com>
On Sun, Jan 18, 2026 at 02:17:30PM -0500, James Bottomley wrote:
> > > Duplicate header are trivially caught by tooling.
> > >
> > > But such rules aren't useful either -- I've seen that Python IDEs
> > > hide import list by default (and probably manage it) because it is
> > > not "real" code.
> > >
> > > Rules for initializers can be harmful because ordering affects code
> > > generation.
> >
> > I agree. I still prefer the upside-down x-mas tree approach for
> > declaring variables, but obviously if they also get initialized, then
> > that trumps aesthetic reasoning.
>
> How is any of this relevant to a style document? You're quibbling over
> individual maintainer foibles which, while they may be deeply held to
> you (and obviously are relevant to contributors to your subsystems
> because they need to know your foibles), can't be part of our universal
> advice because not all maintainers agree (not even on the direction of
> the Christmas Tree).
>
The direction of the Christmas Tree is always upside down. That's a
standard in networking and a bunch of other subsystems. Otherwise
people don't care. I've seen people who write code in Right Side Up
Christmas Tree style but they don't reject code which is in a different
order.
If you're working across the entire kernel like I do then it's safest
to assume Upside Down Christmas Tree is the rule.
regards,
dan carpenter
next prev parent reply other threads:[~2026-01-18 19:33 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 16:39 Clarifying confusion of our variable placement rules caused by cleanup.h James Bottomley
2025-11-18 17:18 ` Bart Van Assche
2025-11-18 18:38 ` Linus Torvalds
2025-11-18 19:04 ` Bart Van Assche
2025-11-18 19:14 ` Linus Torvalds
2025-11-18 20:43 ` Al Viro
2025-11-18 19:15 ` H. Peter Anvin
2025-11-18 19:11 ` H. Peter Anvin
2025-11-18 19:16 ` Linus Torvalds
2025-11-18 19:19 ` H. Peter Anvin
2025-11-18 19:17 ` Steven Rostedt
2025-11-18 19:22 ` Linus Torvalds
2025-11-18 19:56 ` Steven Rostedt
2025-11-18 20:23 ` Linus Torvalds
2025-11-18 21:05 ` Linus Torvalds
2025-11-18 20:21 ` James Bottomley
2025-11-18 20:30 ` Linus Torvalds
2025-11-18 20:51 ` Steven Rostedt
2025-11-18 21:10 ` James Bottomley
2025-11-18 22:34 ` Steven Rostedt
2025-11-18 23:32 ` James Bottomley
2025-11-18 19:23 ` H. Peter Anvin
2025-11-18 20:28 ` James Bottomley
2025-11-25 13:09 ` Jani Nikula
2025-11-25 14:25 ` Alexey Dobriyan
2025-11-25 15:32 ` Stephen Hemminger
2025-11-25 16:04 ` Steven Rostedt
2025-11-25 17:57 ` H. Peter Anvin
2025-12-31 12:17 ` Andy Shevchenko
2026-01-02 14:50 ` Steven Rostedt
2026-01-17 16:23 ` Alexey Dobriyan
2026-01-17 16:54 ` Bird, Tim
2026-01-17 23:32 ` David Laight
2026-01-18 16:04 ` Steven Rostedt
2026-01-18 19:12 ` Paul E. McKenney
2026-01-18 19:17 ` James Bottomley
2026-01-18 19:33 ` Dan Carpenter [this message]
2026-01-18 19:52 ` Joe Perches
2026-01-18 21:07 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aW01ludvLz9xNzkd@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=adobriyan@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ksummit@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.