Re: Coding Style: Reverse XMAS tree declarations ? (was Re: [PATCH net-next v6 02/10] dpaa_eth: add support for DPAA Ethernet)

2016-11-04 Thread David VomLehn
On Fri, Nov 04, 2016 at 10:05:15AM -0700, Randy Dunlap wrote:
> On 11/03/16 23:53, Joe Perches wrote:
> > On Thu, 2016-11-03 at 15:58 -0400, David Miller wrote:
> >> From: Madalin Bucur 
> >> Date: Wed, 2 Nov 2016 22:17:26 +0200
> >>
> >>> This introduces the Freescale Data Path Acceleration Architecture
> >>> +static inline size_t bpool_buffer_raw_size(u8 index, u8 cnt)
> >>> +{
> >>> + u8 i;
> >>> + size_t res = DPAA_BP_RAW_SIZE / 2;
> >>
> >> Always order local variable declarations from longest to shortest line,
> >> also know as Reverse Christmas Tree Format.
> > 
> > I think this declaration sorting order is misguided but
> > here's a possible change to checkpatch adding a test for it
> > that does this test just for net/ and drivers/net/
> 
> I agree with the misguided part.
> That's not actually in CodingStyle AFAICT. Where did this come from?
> 
> 
> thanks.
> -- 
> ~Randy

This puzzles me. The CodingStyle gives some pretty reasonable rationales
for coding style over above the "it's easier to read if it all looks the
same". I can see rationales for other approaches (and I am not proposing
any of these):

alphabetic orderEasier to search for declarations
complex to simple   As in, structs and unions, pointers to simple
data (int, char), simple data. It seems like I
can deduce the simple types from usage, but more
complex I need to know things like the
particular structure.
group by usage  Mirror the ontological locality in the code

Do we have a basis for thinking this is easier or more consistent than
any other approach?
-- 
David VL


Re: RFC: Mega rename of device tree routines from of_*() to dt_*()

2010-11-24 Thread David VomLehn
On Thu, Nov 25, 2010 at 01:03:33AM +1100, Michael Ellerman wrote:
 Hi all,
 
 There were some murmurings on IRC last week about renaming the of_*()
 routines. I was procrastinating at the time and said I'd have a look at
 it, so here I am.
 
 The thinking is that on many platforms that use the of_() routines
 OpenFirmware is not involved at all, this is true even on many powerpc
 platforms. Also for folks who don't know the OpenFirmware connection it
 reads as of, as in a can of worms.
 
 Personally I'm a bit ambivalent about it, the OF name is a bit wrong so
 it would be nice to get rid of, but it's a lot of churn.
 
 So I'm hoping people with either say YES this is a great idea, or NO
 this is stupid.
 
 As step one I've just renamed as many routines as I could find to see
 what the resulting patch looks like, so we can quantify the churn. I
 also did device.of_node, which is used quite a bit.
 
 Thoughts?

I'm looking at it the other way. There are inconsistencies in naming of
symbols and files we definitely should clean up. Since we're doing that,
let's take the opportunity to move from of* to dt*. With multiple
architectures adding device tree support, this is about the last chance
to do this without impacting too many people.
-- 
David VL
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev