|
|
Log in / Subscribe / Register

Reverse Christmas trees

Reverse Christmas trees

Posted Jun 28, 2018 14:48 UTC (Thu) by corbet (editor, #1)
In reply to: Let them run CAKE by mtaht
Parent article: Let them run CAKE

One of the many obstacles we put in the path of incoming kernel developers is the fact that different subsystems have different rules, and many of them are not written down. The cosmetic ordering of local variable declarations is one of those; only a few maintainers insist on that, while most really do not care or think that it's actively silly. There would probably be a fair amount of opposition to enshrining this requirement in checkpatch.pl.

There's been a low rumble of conversation for a bit about trying to document the subsystem-specific rules — both to make them easier to follow and to simply shine some sunlight on some of them. But we've not managed to make any progress on that yet.


to post comments

Reverse Christmas trees

Posted Jun 28, 2018 22:53 UTC (Thu) by gerdesj (subscriber, #5446) [Link]

"It is probably fair to say that many developers would have given up on getting this code merged by now"

"One of the many obstacles we put in the path of incoming kernel developers is the fact that different subsystems have different rules, and many of them are not written down."

Perhaps those subsystems might like to update checkpatch.pl if they require additional "rules" not already covered by Mr T for the whole project. Surely a maintainer could save loads of time by investing a few hours with perl n git *once* and not have to keep NACKing stuff with style snags, *forever* P)

Reverse Christmas trees

Posted Jun 29, 2018 2:39 UTC (Fri) by marcH (subscriber, #57642) [Link]

> The cosmetic ordering of local variable declarations is one of those; only a few maintainers insist on that, while most really do not care or think that it's actively silly.

As often with code style questions, either extreme position (strict enforcement or not caring at all) is too simplistic and wrong. This rule does make the code easier to read but other considerations like dependencies or logical grouping should be able to outweigh it easily. I believe checkpatch documentation has a good warning against robotic enforcement.

PS: one-letter variables, really? This function is barely readable unless you're an expert (and even then I'm not sure)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds