Skip to content

Commit 01ccf9b

Browse files
committed
x86/apic: Use u32 for phys_pkg_id()
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 even if that callback going to be removed soonish. 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 8aa2a41 commit 01ccf9b

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

arch/x86/include/asm/apic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ struct apic {
296296
void (*init_apic_ldr)(void);
297297
void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
298298
u32 (*cpu_present_to_apicid)(int mps_cpu);
299-
int (*phys_pkg_id)(int cpuid_apic, int index_msb);
299+
u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
300300

301301
u32 (*get_apic_id)(unsigned long x);
302302
u32 (*set_apic_id)(unsigned int id);

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static u32 set_apic_id(unsigned int id)
6666
return (id & 0xFF) << 24;
6767
}
6868

69-
static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
69+
static u32 flat_phys_pkg_id(u32 initial_apic_id, int index_msb)
7070
{
7171
return initial_apic_id >> index_msb;
7272
}

arch/x86/kernel/apic/apic_noop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void noop_send_IPI_self(int vector) { }
2929
static void noop_apic_icr_write(u32 low, u32 id) { }
3030
static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip) { return -1; }
3131
static u64 noop_apic_icr_read(void) { return 0; }
32-
static int noop_phys_pkg_id(int cpuid_apic, int index_msb) { return 0; }
32+
static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; }
3333
static unsigned int noop_get_apic_id(unsigned long x) { return 0; }
3434
static void noop_apic_eoi(void) { }
3535

arch/x86/kernel/apic/apic_numachip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static u32 numachip2_set_apic_id(unsigned int id)
5656
return id << 24;
5757
}
5858

59-
static int numachip_phys_pkg_id(int initial_apic_id, int index_msb)
59+
static u32 numachip_phys_pkg_id(u32 initial_apic_id, int index_msb)
6060
{
6161
return initial_apic_id >> index_msb;
6262
}

arch/x86/kernel/apic/bigsmp_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *re
2929
physids_promote(0xFFL, retmap);
3030
}
3131

32-
static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
32+
static u32 bigsmp_phys_pkg_id(u32 cpuid_apic, int index_msb)
3333
{
3434
return cpuid_apic >> index_msb;
3535
}

arch/x86/kernel/apic/local.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest);
1818
unsigned int x2apic_get_apic_id(unsigned long id);
1919
u32 x2apic_set_apic_id(unsigned int id);
20-
int x2apic_phys_pkg_id(int initial_apicid, int index_msb);
20+
u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb);
2121

2222
void x2apic_send_IPI_all(int vector);
2323
void x2apic_send_IPI_allbutself(int vector);

arch/x86/kernel/apic/probe_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "local.h"
2020

21-
static int default_phys_pkg_id(int cpuid_apic, int index_msb)
21+
static u32 default_phys_pkg_id(u32 cpuid_apic, int index_msb)
2222
{
2323
return cpuid_apic >> index_msb;
2424
}

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ u32 x2apic_set_apic_id(unsigned int id)
134134
return id;
135135
}
136136

137-
int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
137+
u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb)
138138
{
139139
return initial_apicid >> index_msb;
140140
}

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ static unsigned int uv_read_apic_id(void)
789789
return x2apic_get_apic_id(apic_read(APIC_ID));
790790
}
791791

792-
static int uv_phys_pkg_id(int initial_apicid, int index_msb)
792+
static u32 uv_phys_pkg_id(u32 initial_apicid, int index_msb)
793793
{
794794
return uv_read_apic_id() >> index_msb;
795795
}

arch/x86/kernel/vsmp_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void __init vsmp_cap_cpus(void)
127127
#endif
128128
}
129129

130-
static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
130+
static u32 apicid_phys_pkg_id(u32 initial_apic_id, int index_msb)
131131
{
132132
return read_apic_id() >> index_msb;
133133
}

arch/x86/xen/apic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int xen_madt_oem_check(char *oem_id, char *oem_table_id)
110110
return xen_pv_domain();
111111
}
112112

113-
static int xen_phys_pkg_id(int initial_apic_id, int index_msb)
113+
static u32 xen_phys_pkg_id(u32 initial_apic_id, int index_msb)
114114
{
115115
return initial_apic_id >> index_msb;
116116
}

0 commit comments

Comments
 (0)