LWN.net Logo

example code nitpicks

example code nitpicks

Posted Dec 20, 2007 21:15 UTC (Thu) by ntl (subscriber, #40518)
Parent article: What is RCU, Fundamentally?

Shouldn't the list_head and hlist_node structs be embedded in struct foo, instead of pointers? That is,

struct foo {
-   struct list_head *list;
+   struct list_head list;
   ...
}
Also, no need to cast the return value of kmalloc :)


(Log in to post comments)

example code nitpicks

Posted Dec 21, 2007 1:03 UTC (Fri) by PaulMcKenney (subscriber, #9624) [Link]

Good catch in both cases!

example code nitpicks

Posted Dec 21, 2007 17:08 UTC (Fri) by PaulMcKenney (subscriber, #9624) [Link]

And many thanks to Jon Corbet for applying the fixes for these problems!

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