Skip to content

Commit 1429b56

Browse files
JuliaLawallsuryasaimadhu
authored andcommitted
x86/crash: Use resource_size()
Use resource_size() rather than a verbose computation on the end and start fields. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) <smpl> @@ struct resource ptr; @@ - (ptr.end - ptr.start + 1) + resource_size(&ptr) </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b47a369 commit 1429b56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/crash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
370370
/* Add crashk_low_res region */
371371
if (crashk_low_res.end) {
372372
ei.addr = crashk_low_res.start;
373-
ei.size = crashk_low_res.end - crashk_low_res.start + 1;
373+
ei.size = resource_size(&crashk_low_res);
374374
ei.type = E820_TYPE_RAM;
375375
add_e820_entry(params, &ei);
376376
}

0 commit comments

Comments
 (0)