Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


KernelTrap: Debating Coding Style

Sep 23, 2005, 04:00 (1 Talkback[s])

"The Linux kernel coding style document was recently upgraded to say 'the preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...);.' Russell King disagreed with this suggestion, listing several reasons it was problematic. He was quickly joined by others including Al Viro, Robert Love, and Alan Cox, who agreed and added additional reasons why this coding convention could be problematic, suggesting instead to use 'p = kmalloc(sizeof(struct foo), ...).' The reasons cited included the difficulty in grepping for such allocations and initializations, confusion over the fact the sizeof(*p) is the size of for example a void *, not the full space for the object allocated and overall readability..."

Complete Story

Related Stories: