Skip to content

Commit 5d376b8

Browse files
committed
x86/apic: Use u32 for check_apicid_used()
APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width and move the default implementation to local.h as there are no users outside the apic directory. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Juergen Gross <[email protected]> Tested-by: Sohil Mehta <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Zhang Rui <[email protected]> Reviewed-by: Arjan van de Ven <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4705243 commit 5d376b8

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

arch/x86/include/asm/apic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ struct apic {
292292
int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
293293
bool (*apic_id_registered)(void);
294294

295-
bool (*check_apicid_used)(physid_mask_t *map, int apicid);
295+
bool (*check_apicid_used)(physid_mask_t *map, u32 apicid);
296296
void (*init_apic_ldr)(void);
297297
void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
298298
int (*cpu_present_to_apicid)(int mps_cpu);
@@ -538,7 +538,6 @@ extern int default_apic_id_valid(u32 apicid);
538538
extern u32 apic_default_calc_apicid(unsigned int cpu);
539539
extern u32 apic_flat_calc_apicid(unsigned int cpu);
540540

541-
extern bool default_check_apicid_used(physid_mask_t *map, int apicid);
542541
extern void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap);
543542
extern int default_cpu_present_to_apicid(int mps_cpu);
544543

arch/x86/kernel/apic/apic_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ u32 apic_flat_calc_apicid(unsigned int cpu)
1818
return 1U << cpu;
1919
}
2020

21-
bool default_check_apicid_used(physid_mask_t *map, int apicid)
21+
bool default_check_apicid_used(physid_mask_t *map, u32 apicid)
2222
{
2323
return physid_isset(apicid, *map);
2424
}

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ static struct apic apic_physflat __ro_after_init = {
158158

159159
.disable_esr = 0,
160160

161-
.check_apicid_used = NULL,
162-
.ioapic_phys_id_map = NULL,
163161
.cpu_present_to_apicid = default_cpu_present_to_apicid,
164162
.phys_pkg_id = flat_phys_pkg_id,
165163

arch/x86/kernel/apic/apic_noop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include <asm/apic.h>
2020

21+
#include "local.h"
22+
2123
static void noop_send_IPI(int cpu, int vector) { }
2224
static void noop_send_IPI_mask(const struct cpumask *cpumask, int vector) { }
2325
static void noop_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) { }

arch/x86/kernel/apic/bigsmp_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static unsigned bigsmp_get_apic_id(unsigned long x)
1818
return (x >> 24) & 0xFF;
1919
}
2020

21-
static bool bigsmp_check_apicid_used(physid_mask_t *map, int apicid)
21+
static bool bigsmp_check_apicid_used(physid_mask_t *map, u32 apicid)
2222
{
2323
return false;
2424
}

arch/x86/kernel/apic/local.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void default_send_IPI_all(int vector);
6464
void default_send_IPI_self(int vector);
6565

6666
bool default_apic_id_registered(void);
67+
bool default_check_apicid_used(physid_mask_t *map, u32 apicid);
6768

6869
#ifdef CONFIG_X86_32
6970
void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector);

0 commit comments

Comments
 (0)