From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755005AbdKGTwm (ORCPT ); Tue, 7 Nov 2017 14:52:42 -0500 Received: from terminus.zytor.com ([65.50.211.136]:39163 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754705AbdKGTwi (ORCPT ); Tue, 7 Nov 2017 14:52:38 -0500 Date: Tue, 7 Nov 2017 11:49:08 -0800 From: tip-bot for kbuild test robot Message-ID: Cc: bp@suse.de, linux-kernel@vger.kernel.org, keescook@chromium.org, fengguang.wu@intel.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, thomas.lendacky@amd.com, jgross@suse.com, brijesh.singh@amd.com, mpe@ellerman.id.au Reply-To: thomas.lendacky@amd.com, jgross@suse.com, brijesh.singh@amd.com, mpe@ellerman.id.au, bp@suse.de, linux-kernel@vger.kernel.org, fengguang.wu@intel.com, keescook@chromium.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <20171107191801.GA91887@lkp-snb01> References: <20171107191801.GA91887@lkp-snb01> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] resource: Fix resource_size.cocci warnings Git-Commit-ID: 9275b933d409d3a4efa08102ca813557b93fb0b9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9275b933d409d3a4efa08102ca813557b93fb0b9 Gitweb: https://git.kernel.org/tip/9275b933d409d3a4efa08102ca813557b93fb0b9 Author: kbuild test robot AuthorDate: Wed, 8 Nov 2017 03:18:01 +0800 Committer: Thomas Gleixner CommitDate: Tue, 7 Nov 2017 20:44:56 +0100 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 Signed-off-by: Thomas Gleixner Cc: Juergen Gross Cc: Tom Lendacky Cc: Brijesh Singh Cc: Kees Cook Cc: Michael Ellerman Cc: kbuild-all@01.org Cc: tipbuild@zytor.com Cc: Borislav Petkov Link: https://lkml.kernel.org/r/20171107191801.GA91887@lkp-snb01 --- arch/x86/kernel/crash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 815008c..10e74d4 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;