IMHO the above line is a bad construct. If the type of the variable
changes it is extremely easy to miss the fact that *alloc is now
returning the wrong size. I always do
busy = kmalloc(sizeof(*busy), GFP_KERNEL);
and let the compiler insert the correct type.
For the checker, you can also have typeof(). kdb has this line
typeof (*ef) local_ef;
The type definition of ef is kdb_eframe_t which is "pointer to some
arch dependent type" and local_ef is in arch independent code, much
easier to do this than use multiple #ifdef. Of course it would have
been even easier if kdb had separate types for the struct and the
pointer to the struct, then I would not need typeof(). OTOH I am sure
that somebody will find a use for typeof().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/