diff options
author | kbuild test robot <fengguang.wu@intel.com> | 2017-11-07 22:18:01 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-11-07 22:44:56 +0300 |
commit | 9275b933d409d3a4efa08102ca813557b93fb0b9 (patch) | |
tree | 6e0359c2aea693749cc2e5509de232ef5dcc66b5 /arch | |
parent | 819aeee065e5d1b417ecd633897427c89f3253ec (diff) | |
download | linux-9275b933d409d3a4efa08102ca813557b93fb0b9.tar.xz |
resource: Fix resource_size.cocci warnings
arch/x86/kernel/crash.c:627:34-37: ERROR: Missing resource_size with res
arch/x86/kernel/crash.c:528:16-19: ERROR: Missing resource_size with res
Use resource_size function on resource object
instead of explicit computation.
Generated by: scripts/coccinelle/api/resource_size.cocci
Fixes: 1d2e733b13b4 ("resource: Provide resource struct in resource walk callback")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: kbuild-all@01.org
Cc: tipbuild@zytor.com
Cc: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20171107191801.GA91887@lkp-snb01
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/crash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 815008c9ca18..10e74d4778a1 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -525,7 +525,7 @@ static int memmap_entry_callback(struct resource *res, void *arg) struct e820_entry ei; ei.addr = res->start; - ei.size = res->end - res->start + 1; + ei.size = resource_size(res); ei.type = cmd->type; add_e820_entry(params, &ei); @@ -624,7 +624,7 @@ static int determine_backup_region(struct resource *res, void *arg) struct kimage *image = arg; image->arch.backup_src_start = res->start; - image->arch.backup_src_sz = res->end - res->start + 1; + image->arch.backup_src_sz = resource_size(res); /* Expecting only one range for backup region */ return 1; |