All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@google.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH -next] bcma: needs export.h
Date: Tue, 20 Sep 2011 15:40:23 -0700	[thread overview]
Message-ID: <20110920154023.c90396d8.akpm@google.com> (raw)
In-Reply-To: <CACna6rxGrd-ORWZrc0xsAOKptU_Xj3eGh9qSfX9vJYCPTZrCRg@mail.gmail.com>

On Tue, 20 Sep 2011 20:45:57 +0200
Rafa__ Mi__ecki <zajec5@gmail.com> wrote:

> 2011/9/20 Randy Dunlap <rdunlap@xenotime.net>:
> > From: Randy Dunlap <rdunlap@xenotime.net>
> >
> > bcma/driver_chipcommon_pmu.c needs to include <linux/export.h>,
> > so add it to the headers that are included by bcma_private.h.
> 
> Please take a look at discussion in:
> [PATCH -next] bcma: main.c needs to include <linux/slab.h>
> thread (by Andrew).
> 
> I believe that according to the discussion, such a includes should be
> done in .c files.
> 
> Andrew: can you comment? Am I right?

Ordinarily, yes, it is preferable to include the needed .h files from
within the .c files.  However quite a mumber of kernel subsystems do
take the #include "everything.h" approach.

However, drivers/bcma is a bit odd in that it has bcma_private.h which
includes delay.h (the everything.h approach) but most .c files
explicitly include other things, including export.h.

There's no real pattern here and yes, I agree that the minimal and more
typical approach is better.

--- a/drivers/bcma/driver_chipcommon_pmu.c~bcma-needs-exporth
+++ a/drivers/bcma/driver_chipcommon_pmu.c
@@ -10,6 +10,7 @@
 
 #include "bcma_private.h"
 #include <linux/bcma/bcma.h>
+#include <linux/export.h>
 
 static u32 bcma_chipco_pll_read(struct bcma_drv_cc *cc, u32 offset)
 {
_

  parent reply	other threads:[~2011-09-20 22:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  7:31 linux-next: Tree for Sept 20 Stephen Rothwell
2011-09-20 17:39 ` [PATCH -next] bcma: needs export.h Randy Dunlap
2011-09-20 18:45   ` Rafał Miłecki
2011-09-20 20:43     ` Randy Dunlap
2011-09-20 20:51     ` [PATCH -next v2] bcma: driver_chipcommon_pmu.c needs linux/export.h Randy Dunlap
2011-09-20 21:11       ` Stephen Rothwell
2011-09-21  6:45       ` Rafał Miłecki
2011-09-21 15:52         ` Randy Dunlap
2011-09-21 18:00           ` Rafał Miłecki
2011-09-21 21:07             ` [PATCH -next] bcma: main.c and driver_mips.c need linux/export.h Randy Dunlap
2011-09-21 21:42               ` Larry Finger
2011-09-21 21:49                 ` Randy Dunlap
2011-09-20 22:40     ` Andrew Morton [this message]
2011-09-20 20:39 ` linux-next: Tree for Sept 20 (llc/psnap/p8022) Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110920154023.c90396d8.akpm@google.com \
    --to=akpm@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=sfr@canb.auug.org.au \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.