On Tue, Nov 18, 2014 at 11:05:21PM +0100, Gilles Chanteperdrix wrote: > From what I was told by someone who knew someone who talked to > someone, this was actually actually a two step process (I do not > know whether this changed). > > An team did the work that went into the kernel fork that was > delivered to customers, with rapid delivery date as the priority > goal. > > Then in a second time, a different team started writing the code > that went into mainline, I am not even sure it used the code of the > first team.
Well there is also the question of whether it is the network group or automotive group doing it (sometimes even for the same chip). It does appear that the code is getting reused from the bits I have seen getting mainlines, although at least some of it has needed some cleanups. > I did that. And I prefer explicit bit numbers, because they match > the datasheet, which is the ultimate reference. > > With code relying on defines, you have to trust the define names to > match what you think they do. And I have learned to never trust > identifier names, so I want to check the datasheet anyway, and the > defines do not help, because now instead of having just 4 fields to > check from the same line of code in the documentation of one > register, you have to find the 4 fields definitions in the > middle of a whole bunch of definitions in a separate header file, > and move back and forth. > > So, the bottom line is, while I understand the values of defines to > provide the same name to the same bit, when used in several places, > as would be the case for software bitfield, I do not see the value > of it for register values. If you don't remember which bit is which, having names for them helps you remember what the code does. Or at least put a comment saying "Disabling idle and enabling wakeup, etc". Magic numbers with no explanation are terrible when reading the code. -- Len Sorensen _______________________________________________ Xenomai mailing list [email protected] http://www.xenomai.org/mailman/listinfo/xenomai
