lkml.org 
[lkml]   [2011]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] bcma: main.c needs to include <linux/slab.h>
From
Date
On Mon, 2011-06-27 at 18:49 +0200, Arend van Spriel wrote:

> > That's why I think it's safe to include linux/slab.h in bcma_private.h.
> > But if that's just my opinion, everybody think it's wrong idea, I'm OK with it.
>
> My rule of thumb is: Header file a.h may only include header b.h when
> a.h needs some definition from b.h. Convenience is never a good reason
> for nested includes.

Yeah, good rule. Consider if you have a.h, b.h and z.c, z.c needs b.h
but not a.h, and now b.h includes a.h ("for convenience") -- changing
a.h would needlessly recompile z.c. Now, changing slab.h will probably
recompile everything anyway, but still...

johannes



\
 
 \ /
  Last update: 2011-06-27 18:59    [W:0.072 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site