Skip to content

Commit 57ba79e

Browse files
Robert Richterrafaeljw
authored andcommitted
ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity()
After removing architectural code the helper function acpi_numa_memory_affinity_init() is no longer needed. Squash it into acpi_parse_memory_affinity(). No functional changes intended. While at it, fixing checkpatch complaints in code moved. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Alison Schofield <[email protected]> Signed-off-by: Robert Richter <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f446987 commit 57ba79e

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

drivers/acpi/numa/srat.c

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,30 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
248248
return 0;
249249
}
250250

251+
static int parsed_numa_memblks __initdata;
252+
251253
static int __init
252-
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
254+
acpi_parse_memory_affinity(union acpi_subtable_headers *header,
255+
const unsigned long table_end)
253256
{
257+
struct acpi_srat_mem_affinity *ma;
254258
u64 start, end;
255259
u32 hotpluggable;
256260
int node, pxm;
257261

262+
ma = (struct acpi_srat_mem_affinity *)header;
263+
264+
acpi_table_print_srat_entry(&header->common);
265+
258266
if (srat_disabled())
259-
goto out_err;
267+
return 0;
260268
if (ma->header.length < sizeof(struct acpi_srat_mem_affinity)) {
261269
pr_err("SRAT: Unexpected header length: %d\n",
262270
ma->header.length);
263271
goto out_err_bad_srat;
264272
}
265273
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
266-
goto out_err;
274+
return 0;
267275
hotpluggable = IS_ENABLED(CONFIG_MEMORY_HOTPLUG) &&
268276
(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE);
269277

@@ -301,11 +309,15 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
301309

302310
max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
303311

312+
parsed_numa_memblks++;
313+
304314
return 0;
315+
305316
out_err_bad_srat:
317+
/* Just disable SRAT, but do not fail and ignore errors. */
306318
bad_srat();
307-
out_err:
308-
return -EINVAL;
319+
320+
return 0;
309321
}
310322

311323
static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
@@ -438,24 +450,6 @@ acpi_parse_gi_affinity(union acpi_subtable_headers *header,
438450
}
439451
#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */
440452

441-
static int __initdata parsed_numa_memblks;
442-
443-
static int __init
444-
acpi_parse_memory_affinity(union acpi_subtable_headers * header,
445-
const unsigned long end)
446-
{
447-
struct acpi_srat_mem_affinity *memory_affinity;
448-
449-
memory_affinity = (struct acpi_srat_mem_affinity *)header;
450-
451-
acpi_table_print_srat_entry(&header->common);
452-
453-
/* let architecture-dependent part to do it */
454-
if (!acpi_numa_memory_affinity_init(memory_affinity))
455-
parsed_numa_memblks++;
456-
return 0;
457-
}
458-
459453
static int __init acpi_parse_srat(struct acpi_table_header *table)
460454
{
461455
struct acpi_table_srat *srat = (struct acpi_table_srat *)table;

0 commit comments

Comments
 (0)