[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171107191801.GA91887@lkp-snb01>
Date: Wed, 8 Nov 2017 03:18:01 +0800
From: kbuild test robot <fengguang.wu@...el.com>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: kbuild-all@...org, linux-kernel@...r.kernel.org,
tipbuild@...or.com, Thomas Gleixner <tglx@...utronix.de>,
Brijesh Singh <brijesh.singh@....com>,
Kees Cook <keescook@...omium.org>,
Borislav Petkov <bp@...e.de>, Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Michael Ellerman <mpe@...erman.id.au>,
Juergen Gross <jgross@...e.com>
Subject: [PATCH] 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")
CC: Tom Lendacky <thomas.lendacky@....com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
crash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -525,7 +525,7 @@ static int memmap_entry_callback(struct
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(struc
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;
Powered by blists - more mailing lists