Skip to content

Commit

Permalink
ia64: cpumask fix for is_affinity_mask_valid()
Browse files Browse the repository at this point in the history
Impact: cleanup

The function prototype should use 'struct cpumask *' to declare
cpumask arguments (instead of cpumask_var_t).

Note: arch/ia64/kernel/irq.c still had the following "old cpumask_t" usages:

105:	cpumask_t mask = CPU_MASK_NONE;
107:	cpu_set(cpu_logical_id(hwid), mask);
110:                 irq_desc[irq].affinity = mask;

	... replaced with a simple "cpumask_of(cpu_logical_id(hwid))".

161:			new_cpu = any_online_cpu(cpu_online_map);
194:		time_keeper_id = first_cpu(cpu_online_map);

	... replaced with cpu_online_mask refs.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Mike Travis authored and Ingo Molnar committed Jan 4, 2009
1 parent 7d3b56b commit d3b66bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ irq_canonicalize (int irq)
}

extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
bool is_affinity_mask_valid(cpumask_var_t cpumask);
bool is_affinity_mask_valid(const struct cpumask *cpumask);

#define is_affinity_mask_valid is_affinity_mask_valid

Expand Down
15 changes: 6 additions & 9 deletions arch/ia64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,14 @@ static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };

void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
{
cpumask_t mask = CPU_MASK_NONE;

cpu_set(cpu_logical_id(hwid), mask);

if (irq < NR_IRQS) {
irq_desc[irq].affinity = mask;
cpumask_copy(&irq_desc[irq].affinity,
cpumask_of(cpu_logical_id(hwid)));
irq_redir[irq] = (char) (redir & 0xff);
}
}

bool is_affinity_mask_valid(cpumask_var_t cpumask)
bool is_affinity_mask_valid(const struct cpumask *cpumask)
{
if (ia64_platform_is("sn2")) {
/* Only allow one CPU to be specified in the smp_affinity mask */
Expand All @@ -128,7 +125,7 @@ bool is_affinity_mask_valid(cpumask_var_t cpumask)
unsigned int vectors_in_migration[NR_IRQS];

/*
* Since cpu_online_map is already updated, we just need to check for
* Since cpu_online_mask is already updated, we just need to check for
* affinity that has zeros
*/
static void migrate_irqs(void)
Expand Down Expand Up @@ -158,7 +155,7 @@ static void migrate_irqs(void)
*/
vectors_in_migration[irq] = irq;

new_cpu = any_online_cpu(cpu_online_map);
new_cpu = cpumask_any(cpu_online_mask);

/*
* Al three are essential, currently WARN_ON.. maybe panic?
Expand Down Expand Up @@ -191,7 +188,7 @@ void fixup_irqs(void)
* Find a new timesync master
*/
if (smp_processor_id() == time_keeper_id) {
time_keeper_id = first_cpu(cpu_online_map);
time_keeper_id = cpumask_first(cpu_online_mask);
printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id);
}

Expand Down

0 comments on commit d3b66bf

Please sign in to comment.