mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	tipbuild@zytor.com, Thomas Gleixner <tglx@linutronix.de>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH] resource: fix resource_size.cocci warnings
Date: Wed, 8 Nov 2017 03:18:01 +0800	[thread overview]
Message-ID: <20171107191801.GA91887@lkp-snb01> (raw)
In-Reply-To: <201711080355.uRfu6tkq%fengguang.wu@intel.com>

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@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.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;

  reply	other threads:[~2017-11-07 19:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 19:18 [tip:x86/asm 9/17] arch/x86/kernel/crash.c:627:34-37: ERROR: Missing resource_size with res kbuild test robot
2017-11-07 19:18 ` kbuild test robot [this message]
2017-11-07 19:49   ` [tip:x86/asm] resource: Fix resource_size.cocci warnings tip-bot for kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171107191801.GA91887@lkp-snb01 \
    --to=fengguang.wu@intel.com \
    --cc=bp@suse.de \
    --cc=brijesh.singh@amd.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tipbuild@zytor.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome