Skip to content

Commit 2900060

Browse files
committed
Fix small issues in x86 initialization code
1 parent d51d395 commit 2900060

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/x86/linux/init.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,11 @@ void cpuinfo_x86_linux_init(void) {
236236
}
237237
packages = calloc(packages_count, sizeof(struct cpuinfo_package));
238238
if (packages == NULL) {
239-
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" cores",
239+
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" physical packages",
240240
packages_count * sizeof(struct cpuinfo_package), packages_count);
241241
goto cleanup;
242242
}
243+
243244
if (l1i_count != 0) {
244245
l1i = calloc(l1i_count, sizeof(struct cpuinfo_cache));
245246
if (l1i == NULL) {

src/x86/windows/init.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PV
286286

287287
packages = HeapAlloc(heap, HEAP_ZERO_MEMORY, packages_count * sizeof(struct cpuinfo_package));
288288
if (packages == NULL) {
289-
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" packages",
289+
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" physical packages",
290290
packages_count * sizeof(struct cpuinfo_package), packages_count);
291291
goto cleanup;
292292
}
@@ -300,7 +300,7 @@ BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PV
300300
(struct cpuinfo_core*) ((uintptr_t) cores + (uintptr_t) processor->core);
301301
processor->core = core;
302302
struct cpuinfo_package* package =
303-
(struct cpuinfo_package*) ((uintptr_t)packages + (uintptr_t)processor->package);
303+
(struct cpuinfo_package*) ((uintptr_t) packages + (uintptr_t) processor->package);
304304
processor->package = package;
305305

306306
/* This can be overwritten by lower-index processors on the same package */

0 commit comments

Comments
 (0)