Skip to content

Commit 137221d

Browse files
Christoph HellwigKAGA-KOKO
authored andcommitted
genirq: Move pending helpers to internal.h
So that the affinity code can reuse them. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Keith Busch <keith.busch@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20170619235445.109426284@linutronix.de
1 parent 2e05155 commit 137221d

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

kernel/irq/internals.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,44 @@ irq_init_generic_chip(struct irq_chip_generic *gc, const char *name,
249249
void __iomem *reg_base, irq_flow_handler_t handler) { }
250250
#endif /* CONFIG_GENERIC_IRQ_CHIP */
251251

252+
#ifdef CONFIG_GENERIC_PENDING_IRQ
253+
static inline bool irq_can_move_pcntxt(struct irq_data *data)
254+
{
255+
return irqd_can_move_in_process_context(data);
256+
}
257+
static inline bool irq_move_pending(struct irq_data *data)
258+
{
259+
return irqd_is_setaffinity_pending(data);
260+
}
261+
static inline void
262+
irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask)
263+
{
264+
cpumask_copy(desc->pending_mask, mask);
265+
}
266+
static inline void
267+
irq_get_pending(struct cpumask *mask, struct irq_desc *desc)
268+
{
269+
cpumask_copy(mask, desc->pending_mask);
270+
}
271+
#else /* CONFIG_GENERIC_PENDING_IRQ */
272+
static inline bool irq_can_move_pcntxt(struct irq_data *data)
273+
{
274+
return true;
275+
}
276+
static inline bool irq_move_pending(struct irq_data *data)
277+
{
278+
return false;
279+
}
280+
static inline void
281+
irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask)
282+
{
283+
}
284+
static inline void
285+
irq_get_pending(struct cpumask *mask, struct irq_desc *desc)
286+
{
287+
}
288+
#endif /* CONFIG_GENERIC_PENDING_IRQ */
289+
252290
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
253291
void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
254292
void irq_remove_debugfs_entry(struct irq_desc *desc);

kernel/irq/manage.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -168,34 +168,6 @@ void irq_set_thread_affinity(struct irq_desc *desc)
168168
set_bit(IRQTF_AFFINITY, &action->thread_flags);
169169
}
170170

171-
#ifdef CONFIG_GENERIC_PENDING_IRQ
172-
static inline bool irq_can_move_pcntxt(struct irq_data *data)
173-
{
174-
return irqd_can_move_in_process_context(data);
175-
}
176-
static inline bool irq_move_pending(struct irq_data *data)
177-
{
178-
return irqd_is_setaffinity_pending(data);
179-
}
180-
static inline void
181-
irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask)
182-
{
183-
cpumask_copy(desc->pending_mask, mask);
184-
}
185-
static inline void
186-
irq_get_pending(struct cpumask *mask, struct irq_desc *desc)
187-
{
188-
cpumask_copy(mask, desc->pending_mask);
189-
}
190-
#else
191-
static inline bool irq_can_move_pcntxt(struct irq_data *data) { return true; }
192-
static inline bool irq_move_pending(struct irq_data *data) { return false; }
193-
static inline void
194-
irq_copy_pending(struct irq_desc *desc, const struct cpumask *mask) { }
195-
static inline void
196-
irq_get_pending(struct cpumask *mask, struct irq_desc *desc) { }
197-
#endif
198-
199171
int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
200172
bool force)
201173
{

0 commit comments

Comments
 (0)