From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
Alessandro Rubini <rubini@gnudd.com>
Subject: [PATCH] fmc: don't include moduleparam.h in include/linux header files.
Date: Fri, 9 Sep 2016 10:27:01 -0400 [thread overview]
Message-ID: <20160909142701.14057-1-paul.gortmaker@windriver.com> (raw)
We try to keep cross linkages between include/linux files to
a minimum wherever possible. To that end, we avoid having the
include/linux headers sourcing module.h or moduleparam.h (which
sources module.h).
Here we see moduleparam.h was included in one for the following:
/* These are the generic parameters, that drivers may instantiate */
#define FMC_PARAM_BUSID(_d) \
module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444)
#define FMC_PARAM_GATEWARE(_d) \
module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444)
However, since they are #define, it is the driver's responsibility to
include moduleparam.h should it decide to make use of any of these.
So move the include to the one and only driver to use these macros and
ensure we keep setting the proper example in include/linux headers.
Cc: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/fmc/fmc-trivial.c | 1 +
include/linux/fmc.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fmc/fmc-trivial.c b/drivers/fmc/fmc-trivial.c
index 6c590f54c79d..44d93dd88a5f 100644
--- a/drivers/fmc/fmc-trivial.c
+++ b/drivers/fmc/fmc-trivial.c
@@ -13,6 +13,7 @@
/* A trivial fmc driver that can load a gateware file and reports interrupts */
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
diff --git a/include/linux/fmc.h b/include/linux/fmc.h
index a5f0aa5c2a8d..2aeea0a747a4 100644
--- a/include/linux/fmc.h
+++ b/include/linux/fmc.h
@@ -10,7 +10,6 @@
#ifndef __LINUX_FMC_H__
#define __LINUX_FMC_H__
#include <linux/types.h>
-#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/list.h>
#include <linux/interrupt.h>
--
2.8.4
next reply other threads:[~2016-09-09 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-09 14:27 Paul Gortmaker [this message]
2016-09-09 14:55 ` [PATCH] fmc: don't include moduleparam.h in include/linux header files Alessandro Rubini
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=20160909142701.14057-1-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rubini@gnudd.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.