Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f062896 authored by Rusty Russell's avatar Rusty Russell
Browse files

cpumask: use new cpumask functions throughout x86



Impact: cleanup

1) &cpu_online_map -> cpu_online_mask
2) first_cpu/next_cpu_nr -> cpumask_first/cpumask_next
3) cpu_*_map manipulation -> init_cpu_* / set_cpu_*

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 3f76a183
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -174,11 +174,11 @@ static inline int early_cpu_to_node(int cpu)


static inline const cpumask_t *cpumask_of_node(int node)
static inline const cpumask_t *cpumask_of_node(int node)
{
{
	return &cpu_online_map;
	return cpu_online_mask;
}
}
static inline int node_to_first_cpu(int node)
static inline int node_to_first_cpu(int node)
{
{
	return first_cpu(cpu_online_map);
	return cpumask_first(cpu_online_mask);
}
}


static inline void setup_node_to_cpumask_map(void) { }
static inline void setup_node_to_cpumask_map(void) { }
+8 −8
Original line number Original line Diff line number Diff line
@@ -26,12 +26,12 @@ static int bigsmp_apic_id_registered(void)
	return 1;
	return 1;
}
}


static const cpumask_t *bigsmp_target_cpus(void)
static const struct cpumask *bigsmp_target_cpus(void)
{
{
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
	return &cpu_online_map;
	return cpu_online_mask;
#else
#else
	return &cpumask_of_cpu(0);
	return cpumask_of(0);
#endif
#endif
}
}


@@ -118,9 +118,9 @@ static int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)
}
}


/* As we are using single CPU as destination, pick only one CPU here */
/* As we are using single CPU as destination, pick only one CPU here */
static unsigned int bigsmp_cpu_mask_to_apicid(const cpumask_t *cpumask)
static unsigned int bigsmp_cpu_mask_to_apicid(const struct cpumask *cpumask)
{
{
	return bigsmp_cpu_to_logical_apicid(first_cpu(*cpumask));
	return bigsmp_cpu_to_logical_apicid(cpumask_first(cpumask));
}
}


static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
@@ -188,10 +188,10 @@ static const struct dmi_system_id bigsmp_dmi_table[] = {
	{ } /* NULL entry stops DMI scanning */
	{ } /* NULL entry stops DMI scanning */
};
};


static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
{
{
	cpus_clear(*retmask);
	cpumask_clear(retmask);
	cpu_set(cpu, *retmask);
	cpumask_set_cpu(cpu, retmask);
}
}


static int probe_bigsmp(void)
static int probe_bigsmp(void)
+3 −3
Original line number Original line Diff line number Diff line
@@ -460,9 +460,9 @@ static const cpumask_t *target_cpus_cluster(void)
	return cpu_all_mask;
	return cpu_all_mask;
}
}


static const cpumask_t *es7000_target_cpus(void)
static const struct cpumask *es7000_target_cpus(void)
{
{
	return &cpumask_of_cpu(smp_processor_id());
	return cpumask_of(smp_processor_id());
}
}


static unsigned long
static unsigned long
@@ -517,7 +517,7 @@ static void es7000_setup_apic_routing(void)
	  "Enabling APIC mode:  %s. Using %d I/O APICs, target cpus %lx\n",
	  "Enabling APIC mode:  %s. Using %d I/O APICs, target cpus %lx\n",
		(apic_version[apic] == 0x14) ?
		(apic_version[apic] == 0x14) ?
			"Physical Cluster" : "Logical Cluster",
			"Physical Cluster" : "Logical Cluster",
		nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
		nr_ioapics, cpumask_bits(es7000_target_cpus())[0]);
}
}


static int es7000_apicid_to_node(int logical_apicid)
static int es7000_apicid_to_node(int logical_apicid)
+1 −1
Original line number Original line Diff line number Diff line
@@ -192,7 +192,7 @@ static const cpumask_t *summit_target_cpus(void)
	 * dest_LowestPrio mode logical clustered apic interrupt routing
	 * dest_LowestPrio mode logical clustered apic interrupt routing
	 * Just start on cpu 0.  IRQ balancing will spread load
	 * Just start on cpu 0.  IRQ balancing will spread load
	 */
	 */
	return &cpumask_of_cpu(0);
	return cpumask_of(0);
}
}


static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid)
static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid)
+1 −1
Original line number Original line Diff line number Diff line
@@ -249,7 +249,7 @@ void cmci_rediscover(int dying)
	for_each_online_cpu (cpu) {
	for_each_online_cpu (cpu) {
		if (cpu == dying)
		if (cpu == dying)
			continue;
			continue;
		if (set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)))
		if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
			continue;
			continue;
		/* Recheck banks in case CPUs don't all have the same */
		/* Recheck banks in case CPUs don't all have the same */
		if (cmci_supported(&banks))
		if (cmci_supported(&banks))
Loading