Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp479789ybl; Fri, 10 Jan 2020 01:49:35 -0800 (PST) X-Google-Smtp-Source: APXvYqz3+37HlBUG/jpWSNlm+9DyJR1k2NvdLqm3nBq7Mi3i0RQtzopo+Qs88p23b9N5W2TS0qpS X-Received: by 2002:a9d:6251:: with SMTP id i17mr1893637otk.14.1578649774910; Fri, 10 Jan 2020 01:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578649774; cv=none; d=google.com; s=arc-20160816; b=afW7Pi5sCDIT4v9nHeaTJ8EGk2pWYzYIi9lu7BXqBNO+mkCumLP6n/I5CpzhtoMrUE Ka0zXRoCG8pJQgoD0JyZT4LM7dWn8ysG4xXO0+BOPisq9XVGuwapcmoPGWoDEHDlzBiB OGhWC6nvudqo0kIUb8l/CICQikbaSEhSTuY7ZRLJrCZxjrsNzo2S48j/p/GgKMN2fGda 6xBZS7uLFhnNBpzajOHP+JPtnV6PO5H4OJtIZsMLQ6eoO5lf7t4gLkmfkua7SokO9tGG QqySvH3GdQ+LyElpPXu39qqoocAAi8CsQkkZKStM2JLFeBNTatRjK04ouSqlxXAAM143 IRlQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FFFiRJG2Dmj1usFksXLqBJzjpKKPyDXbH4wvjVOZ1fI=; b=lwvPqiyIF5lMaCbZURaIuT8GGzkZkX8xpSS/BNmZSpHWAbq7skwBmsyS4XIRgJL0bc ekc5c8yAC94Z7atAmfpMKEF4xEk84JOXT2Qy1RCSkQD2BUKPvC9dx8vERztQeWjz1M2b cg/BLXAV5bz/I+YouQe5CbU+XT1CEMA+fDhCtdhVZ0uR0K0YEUP0UGhtrExsa/ndI7dN lBKHsfpcAhuSBCQmKUgfBQKiV2xDpNfnHRgaKCQaNNoZ+79jJU0CDVXcgF9OxOBgXCLj Aow45BI45rwKuXwSY/6kBMGRR5sIJpyai6S3jyYzgazYF2DWs9s2dbIlSdhtTy6kkr99 WjUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHeg3zcY; 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 e13si920158otp.164.2020.01.10.01.49.22; Fri, 10 Jan 2020 01:49:34 -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=fHeg3zcY; 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 S1727336AbgAJJsV (ORCPT + 99 others); Fri, 10 Jan 2020 04:48:21 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:37005 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727169AbgAJJsV (ORCPT ); Fri, 10 Jan 2020 04:48:21 -0500 Received: by mail-lf1-f67.google.com with SMTP id b15so988295lfc.4 for ; Fri, 10 Jan 2020 01:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FFFiRJG2Dmj1usFksXLqBJzjpKKPyDXbH4wvjVOZ1fI=; b=fHeg3zcYAN6IsU2PBo8d8qUA5VIjV7aP5xIopvN9+GYaWvabxKQdPZmjlp0elLlMF0 cAlgVxJbtY1aUQfL7gecLka+OXevllMONO5rb7KjGKZoCSHI648HqWeHXbCLSdWJzs5H /fyMLojFbJXZpABWDfDKoEN29rnyISYwIOiYbKWR4vL5sqv9d6yjuVxRMeCkyeO3RJZS 7KC011LldD+8Im5wFPSTICt06key7gj77rLCu0CaWsC/0FA0nf5343ga0Nch1ywFcdcC m6FC1b8wWbTMh3/ZqMcWG+MtfFnwR7sxuNNLxLLAs8FMXzet/DWsZVg2QUXjaLIsKXLa gaqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FFFiRJG2Dmj1usFksXLqBJzjpKKPyDXbH4wvjVOZ1fI=; b=mpo/fY/XzbNai9HXjkGV8ErbCncbUCQVxUtxiPCkawTrmkcqq9Ihmbvx4tUYCAXuXx pcLu0OnK4+3Msej9zZAQcZ1RFUCHgq55Dzqfe/9j0DPrdXCergbAnYze8n/vANk6O3yW J+w6NwnPVOOpEnmTu7MaLaJaSIhNtlbqipB/z7yR8O4mS8tJeNYs4wVQ6ziSkJDpoKAh Xk7+TVtAOWFRHc46YT5vKviIZagKOElUUxRl9AOUeth1ydh3RQJDp6NeGoYyLBXNP3hx eEUOkpd5V9jUHZmjUEmq2jHGrrAoT3x6IXBaE5Tm7U2pVuEIWyb7TWwql4kTtTcGGqTR 3s/Q== X-Gm-Message-State: APjAAAUji1X69V7siTr62u6TGvevCbwT0LQRZhklKWPIlmpScffyFspD t7qjP94Mbmm/NSAE6ZMcg4ToJEU80rXLW04+CQjwOA== X-Received: by 2002:ac2:599c:: with SMTP id w28mr1784527lfn.78.1578649699221; Fri, 10 Jan 2020 01:48:19 -0800 (PST) MIME-Version: 1.0 References: <20200110094304.446-1-zhenzhong.duan@gmail.com> In-Reply-To: <20200110094304.446-1-zhenzhong.duan@gmail.com> From: Zhenzhong Duan Date: Fri, 10 Jan 2020 17:48:07 +0800 Message-ID: Subject: Re: [PATCH v3] x86/boot/KASLR: Fix unused variable warning To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I mean [PATCH v3] On Fri, Jan 10, 2020 at 5:43 PM Zhenzhong Duan w= rote: > > 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 with 'make EXTRA_CFLAGS=3D-Wall binrpm-pkg', fix it by moving 'i' > in the guard. > > arch/x86/boot/compressed/kaslr.c:698:6: warning: unused variable =E2=80= =98i=E2=80=99 [-Wunused-variable] > > Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel i= n 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" > --- > v3: remove changes from 0/1 to false/true per Tglx > add the command details about triggering build warning per Boris > > v2: update description per Boris. > > 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 *reg= ion, > 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 *reg= ion, > } > > #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 >