Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3091862ybf; Mon, 2 Mar 2020 22:53:56 -0800 (PST) X-Google-Smtp-Source: ADFU+vtkhBQ5cZ4b8BHUEaf5pz5lVOfIgizWm8TI2dqJcaM6lCg3cXCZIxKd445GHHp8NV+2OYLK X-Received: by 2002:aca:3354:: with SMTP id z81mr1530049oiz.129.1583218435919; Mon, 02 Mar 2020 22:53:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583218435; cv=none; d=google.com; s=arc-20160816; b=MwWjhQIRZti0judV8wTcx/G9IzKweO8/tp2re+eSdPO35luudu+b0249wbP5LDf4rn 4gR0EQhveP6DKf4qRoyAxhYOSSRLtpYwtW9UqNAcSEPTBH+ks2yEnC3r4ne1Lznxk7Lb wSvFfn3gr4IarYNhu9h9Pg/Z7aurPjIP44fLkcmSBLRmGQNwTstuXEnH/f6S61QXjrvw 7O4wqABVbkXtEbHq1AQnkIRCasj6PaVOonqVH4DFrjViQXBCdy45TShr0P+OKsOxa0Zg mALA/7B8Q2hTvqca2uZmSxPbXWoxECuJmqmFAAjYgLai91JCnqoJXWrskW2RUjghjlHu KDYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uN72wLEDvwlBRCICos4EhVBwO6gbBBFN6vJE7pQ2WOk=; b=OjjH87zGd7O0NVA8S7ZkKWxI4Org0uh104d5fuyzB996A4OFgDw+NTS4qQGiKRxFbb I8iD2ygURCrBrclxFd6CxmfIORunpIwQUUO7kW3SskH6x/lIObzNwEC7C6uYyIpoEdZn HxAAlUHKBFWpCwEM3CbRfm7UFss6dKlia8Fkohq3KvDeSnVqgPKBf6K4BF6Jx8F4kyco +8lnswINeWdTm7n7jK7O9OSMC4J2KXNys6XsOulVTTqXgeJt9zBXuQGHvsdBiGbjfYu0 j9KyVkQ+ejkdbG/hcDAcQDd9Bubf1QajIqkS2+nX2AYaGDCOJYp0+QNJSEUsEcMg1Kaz QFZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U4m4K8Iw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si8097079otk.164.2020.03.02.22.53.43; Mon, 02 Mar 2020 22:53:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U4m4K8Iw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727545AbgCCGwy (ORCPT + 99 others); Tue, 3 Mar 2020 01:52:54 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44320 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbgCCGwy (ORCPT ); Tue, 3 Mar 2020 01:52:54 -0500 Received: by mail-pf1-f193.google.com with SMTP id y5so961266pfb.11 for ; Mon, 02 Mar 2020 22:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uN72wLEDvwlBRCICos4EhVBwO6gbBBFN6vJE7pQ2WOk=; b=U4m4K8Iw9bAuO9WWHp0Vg4j6awd+MPpCjS5FDUij+lsMesZjNwYVKd+uBjUY5Xthr4 yJ5Qhnaea6ekz/F4NKU+Ale+QxqkMBfhPIx8jE9T8RHAQGyzuKwmN2UELjS/XLkvdDte KNSkv6CRGZzDNtyRbSeQzSKIuld+rKYqn1Jxl8UjSuryBRkeVrjazEv9Fem+HAxm749E UKerqe643Q2ZNkLwlys/Pm2FEV02u3Kl07ei/fz6neug80g3RjLZB6X9lQHThuiA9cxJ UWb2ywKq8VgElp7eIklsDq9fvs0IwXRbFMSBEzcrRUXMX54GvQzJjvh9w6SVFZcesrhO 9TMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uN72wLEDvwlBRCICos4EhVBwO6gbBBFN6vJE7pQ2WOk=; b=cSpMLfYjCCVEpUS0rh2FLHnmfdggTAFOaZfUDzxWS78kgDGC6vbhKFltmdVzG5GwFo FKNIE1qbvayTGjKOh7jyPbClHt0rJ576skGDKyqA/A5U9CbB2tZ9rpRQkH84yk1YuFqG I6ZUgpwOp1AKTU+U8UGBGZttDraqB6/1ee/1jx79qMPiQw5ZPvw4ImUCNXOa62u3IpYM os8gv3KsdJKNNSg8ALE2WVfU1U0mDQSSl35vIceHEak3QmRzUz62pDUWo0ZvFdIB/YDb nIDjriLkBKIFtloOZ1Em4tbUohipoKCnRuuu/hs5fijcQAHyA8GNTSTa5c1SXLuC6Kq7 2n6Q== X-Gm-Message-State: ANhLgQ0kCCpoM6AT1j/xbxJFwlQjGi0+suhNqPxi5sv8rCK28FGrdONW +k3Y5HjYUJaNBF2iMQ99+PIHg/qe X-Received: by 2002:a62:c144:: with SMTP id i65mr1718852pfg.260.1583218372707; Mon, 02 Mar 2020 22:52:52 -0800 (PST) Received: from ZB-PF114XEA.360buyad.local ([103.90.76.242]) by smtp.gmail.com with ESMTPSA id t11sm22780754pgi.15.2020.03.02.22.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 22:52:52 -0800 (PST) From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, zhenzhong.duan@gmail.com, Borislav Petkov , "H. Peter Anvin" , Dave Hansen , "Rafael J. Wysocki" Subject: [PATCH 2/2] x86/boot/KASLR: Fix unused variable warning Date: Tue, 3 Mar 2020 14:52:10 +0800 Message-Id: <20200303065210.1279-3-zhenzhong.duan@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303065210.1279-1-zhenzhong.duan@gmail.com> References: <20200303065210.1279-1-zhenzhong.duan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Local variable 'i' is referenced only when CONFIG_MEMORY_HOTREMOVE and CONFIG_ACPI are defined, but definition of variable 'i' is out of guard. If any of the two macros is undefined, below warning triggers during build, fix it by moving 'i' in the guard. arch/x86/boot/compressed/kaslr.c:698:6: warning: unused variable ā€˜iā€™ [-Wunused-variable] Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only") Signed-off-by: Zhenzhong Duan Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Dave Hansen Cc: "Rafael J. Wysocki" --- arch/x86/boot/compressed/kaslr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index d7408af55738..62bc46684581 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -695,7 +695,6 @@ static bool process_mem_region(struct mem_vector *region, unsigned long long minimum, unsigned long long image_size) { - int i; /* * If no immovable memory found, or MEMORY_HOTREMOVE disabled, * use @region directly. @@ -711,6 +710,7 @@ static bool process_mem_region(struct mem_vector *region, } #if defined(CONFIG_MEMORY_HOTREMOVE) && defined(CONFIG_ACPI) + int i; /* * If immovable memory found, filter the intersection between * immovable memory and @region. -- 2.17.1