Skip to content

Commit ec53cf2

Browse files
author
Paul Gortmaker
committed
irq: don't put module.h into irq.h for tracking irqgen modules.
Recent commit "irq: Track the owner of irq descriptor" in commit ID b687380 placed module.h into linux/irq.h but we are trying to limit module.h inclusion to just C files that really need it, due to its size and number of children includes. This targets just reversing that include. Add in the basic "struct module" since that is all we really need to ensure things compile. In theory, b687380 should have added the module.h include to the irqdesc.h header as well, but the implicit module.h everywhere presence masked this from showing up. So give it the "struct module" as well. As for the C files, irqdesc.c is only using THIS_MODULE, so it does not need module.h - give it export.h instead. The C file irq/manage.c is now (as of b687380) using try_module_get and module_put and so it needs module.h (which it already has). Also convert the irq_alloc_descs variants to macros, since all they really do is is call the __irq_alloc_descs primitive. This avoids including export.h and no debug info is lost. Signed-off-by: Paul Gortmaker <[email protected]>
1 parent 1d58996 commit ec53cf2

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

include/linux/irq.h

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
#include <linux/errno.h>
2424
#include <linux/topology.h>
2525
#include <linux/wait.h>
26-
#include <linux/module.h>
2726

2827
#include <asm/irq.h>
2928
#include <asm/ptrace.h>
3029
#include <asm/irq_regs.h>
3130

3231
struct seq_file;
32+
struct module;
3333
struct irq_desc;
3434
struct irq_data;
3535
typedef void (*irq_flow_handler_t)(unsigned int irq,
@@ -567,29 +567,21 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
567567
int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
568568
struct module *owner);
569569

570-
static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
571-
int node)
572-
{
573-
return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
574-
}
570+
/* use macros to avoid needing export.h for THIS_MODULE */
571+
#define irq_alloc_descs(irq, from, cnt, node) \
572+
__irq_alloc_descs(irq, from, cnt, node, THIS_MODULE)
575573

576-
void irq_free_descs(unsigned int irq, unsigned int cnt);
577-
int irq_reserve_irqs(unsigned int from, unsigned int cnt);
574+
#define irq_alloc_desc(node) \
575+
irq_alloc_descs(-1, 0, 1, node)
578576

579-
static inline int irq_alloc_desc(int node)
580-
{
581-
return irq_alloc_descs(-1, 0, 1, node);
582-
}
577+
#define irq_alloc_desc_at(at, node) \
578+
irq_alloc_descs(at, at, 1, node)
583579

584-
static inline int irq_alloc_desc_at(unsigned int at, int node)
585-
{
586-
return irq_alloc_descs(at, at, 1, node);
587-
}
580+
#define irq_alloc_desc_from(from, node) \
581+
irq_alloc_descs(-1, from, 1, node)
588582

589-
static inline int irq_alloc_desc_from(unsigned int from, int node)
590-
{
591-
return irq_alloc_descs(-1, from, 1, node);
592-
}
583+
void irq_free_descs(unsigned int irq, unsigned int cnt);
584+
int irq_reserve_irqs(unsigned int from, unsigned int cnt);
593585

594586
static inline void irq_free_desc(unsigned int irq)
595587
{

include/linux/irqdesc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
struct irq_affinity_notify;
1212
struct proc_dir_entry;
1313
struct timer_rand_state;
14+
struct module;
1415
/**
1516
* struct irq_desc - interrupt descriptor
1617
* @irq_data: per irq and chip data passed down to chip functions

kernel/irq/irqdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
#include <linux/irq.h>
1111
#include <linux/slab.h>
12-
#include <linux/module.h>
12+
#include <linux/export.h>
1313
#include <linux/interrupt.h>
1414
#include <linux/kernel_stat.h>
1515
#include <linux/radix-tree.h>

0 commit comments

Comments
 (0)