Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1480062 > unrolled thread

[PATCH] fmc: don't include moduleparam.h in include/linux header files.

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-09-09 16:30 +0200
Last post2016-09-09 17:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fmc: don't include moduleparam.h in include/linux header files. Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-09-09 16:30 +0200
    Re: [PATCH] fmc: don't include moduleparam.h in include/linux header  files. Alessandro Rubini <rubini@gnudd.com> - 2016-09-09 17:10 +0200

#1480062 — [PATCH] fmc: don't include moduleparam.h in include/linux header files.

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-09-09 16:30 +0200
Subject[PATCH] fmc: don't include moduleparam.h in include/linux header files.
Message-ID<sfuYy-40N-47@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1480090 — Re: [PATCH] fmc: don't include moduleparam.h in include/linux header files.

FromAlessandro Rubini <rubini@gnudd.com>
Date2016-09-09 17:10 +0200
SubjectRe: [PATCH] fmc: don't include moduleparam.h in include/linux header files.
Message-ID<sfvBf-4BZ-1@gated-at.bofh.it>
In reply to#1480062
> 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>

Thanks.

Acked-by:  Alessandro Rubini <rubini@gnudd.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web