From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758777AbdKGTTN (ORCPT ); Tue, 7 Nov 2017 14:19:13 -0500 Received: from mga03.intel.com ([134.134.136.65]:53504 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752365AbdKGTTL (ORCPT ); Tue, 7 Nov 2017 14:19:11 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,360,1505804400"; d="scan'208";a="1240989995" Date: Wed, 8 Nov 2017 03:18:01 +0800 From: kbuild test robot To: Tom Lendacky Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, tipbuild@zytor.com, Thomas Gleixner , Brijesh Singh , Kees Cook , Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Michael Ellerman , Juergen Gross Subject: [PATCH] resource: fix resource_size.cocci warnings Message-ID: <20171107191801.GA91887@lkp-snb01> References: <201711080355.uRfu6tkq%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201711080355.uRfu6tkq%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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;