Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbdLEVDA (ORCPT ); Tue, 5 Dec 2017 16:03:00 -0500 Received: from mga09.intel.com ([134.134.136.24]:58548 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbdLEVC4 (ORCPT ); Tue, 5 Dec 2017 16:02:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,365,1508828400"; d="scan'208";a="181662508" From: Matthew Auld To: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Chris Wilson , Paulo Zanoni , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] x86/early-quirks: replace the magical increment start values Date: Tue, 5 Dec 2017 21:02:42 +0000 Message-Id: <20171205210249.8875-3-matthew.auld@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171205210249.8875-1-matthew.auld@intel.com> References: <20171205210249.8875-1-matthew.auld@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 45 Replace the magical +2, +9 etc. with +MB, which is far easier to read. Suggested-by: Ville Syrjälä Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Ville Syrjälä Cc: Chris Wilson Cc: Paulo Zanoni Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Ville Syrjälä --- arch/x86/kernel/early-quirks.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index d7236e2f5eed..b5b912f3dce8 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -428,9 +428,9 @@ static resource_size_t __init chv_stolen_size(int num, int slot, int func) if (gms < 0x11) return gms * MB(32); else if (gms < 0x17) - return (gms - 0x11 + 2) * MB(4); + return (gms - 0x11) * MB(4) + MB(8); else - return (gms - 0x17 + 9) * MB(4); + return (gms - 0x17) * MB(4) + MB(36); } static resource_size_t __init gen9_stolen_size(int num, int slot, int func) @@ -446,7 +446,7 @@ static resource_size_t __init gen9_stolen_size(int num, int slot, int func) if (gms < 0xf0) return gms * MB(32); else - return (gms - 0xf0 + 1) * MB(4); + return (gms - 0xf0) * MB(4) + MB(4); } struct intel_early_ops { -- 2.14.3