Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3461452ybl; Sun, 12 Jan 2020 18:47:11 -0800 (PST) X-Google-Smtp-Source: APXvYqx6dkvBpBPoV8aq/3da4L5VCJ2DbxhUvJk34GT/WItFqccPXZvBt7Vqp38TOlVqQMpbcxTF X-Received: by 2002:a9d:7519:: with SMTP id r25mr11425614otk.284.1578883631654; Sun, 12 Jan 2020 18:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578883631; cv=none; d=google.com; s=arc-20160816; b=z4VyuzSjsyLbyzM4bKrvivrNR9/aqNGQ+jZcCL3nrbmrSBYAD9QQ1ZDh4cQKGEJU8p R4kdwR7Ft/GSz3GFxWqH35FjtObREHuC8Ue2o47BTZR3TyVDIVGlBPLC1oQ75wCM7OGK 9d7tjAWR97/3hVbEkAb2wobC9WK9JHRKccPS/ofh6duaDOIv0E0qJOB44MYuubWj5bUH briEj2K51IuE9ZlEkFbYL+O7p5WNwu1iF5lEmSEyToOC2KnPJ4FSXsDCapBld1+34c5P inS8eeVgnTD3U0R3IPnBwbdNwM33pOvBo+uwWxstr5Pk6bZ+pQS0eg7WeV93GXE3YJYx QDDg== 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=24/I1qlMqBFXawGKcZCUrgzix2NHvFXwEaDn4ik+j2U=; b=QMl3xPoD/GG5E+AberaHTsN7hNY1Kfq5uQhWnHTwkd5GPUEQb6xxGzqEPsKBKmUM42 3G7QfiI8F2odKKMOU/JIZ9yqZGsW8eOWYzuJms3zxwKi7RBBvQQNNZRI9sOgJN2KCU0W PuS9zatIdnXnUCM/8cwRsGDPEdfUp+yQGTF9jNg7wV29IL+dHeOQ/W9DWHlpvadp9xUp oT7KjA1mJUT8SB9HJn9BQXb8GfDPNwpBSoHjAcLvrFpGCT6MKbd67UxGJ7awLBG4fRSd K6h/sAU45gyJoF8qBe9uWSvZ8VMLUHTdiJRvRV9KVmwaYq4mW5FvloR7Mpaqif5f9JLD kwSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=esi7Itj4; 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 s74si5129052oie.109.2020.01.12.18.46.30; Sun, 12 Jan 2020 18:47:11 -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=esi7Itj4; 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 S1733020AbgAMCn3 (ORCPT + 99 others); Sun, 12 Jan 2020 21:43:29 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46683 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732487AbgAMCn3 (ORCPT ); Sun, 12 Jan 2020 21:43:29 -0500 Received: by mail-lj1-f196.google.com with SMTP id m26so8263111ljc.13 for ; Sun, 12 Jan 2020 18:43:27 -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=24/I1qlMqBFXawGKcZCUrgzix2NHvFXwEaDn4ik+j2U=; b=esi7Itj4DmpSDioUwVhXYRkKxTZ0cZfRIRPkUwYLO6thkX04T7cQnJprHW+yehrMPI wEdujDl/DavLJPfpBbCV4OmeO1qNENQVjk3gnTub6I+dlUOdQJ5R+oZAzgXpb8IkQKhV oPliJ8aBmRFWcPN9bIoV/OG4OUihmzuSBUX7WI9bq0KkuNyXR3QUrlB80N+hHrNpIBfb 9JrawK4EVmXXtRqOLaVQG5gB4m0byjm575jEt58Yt70femg2S37y3tCUqTSlbnQjAsL5 rKqNDq/7croKGCQgyVEaQozc5gaGSO+y7NUNq4JsimHFNk0vQ7WcPLYsqKPFrjgykumn ipdg== 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=24/I1qlMqBFXawGKcZCUrgzix2NHvFXwEaDn4ik+j2U=; b=rW/R/qEogdbBPbyRfrFFxEpUozEH7YCJRY9JgCK0G6N4D9Kegje5Kdes6WawPusY1k OPnPjoW3XIeVa+TaPuzDpLO/J1hsfERJBwa0DnqHNgxnlDugUZbGoAYIJNXGyt2JskDD 8aSdRd5Ok9JKse/ziTCZ/L+PDdj8GpiNUYM55rL7VHxa31Q7qiyZUViPe5CBt16v93Jn SGPNLrln2RHTuBPq6o+dsVL2svdf0XQnpP8/Mz2OWv3xnRIeBs2rs8AYZyzL68AdA3Io Wwpx/6BmAK1ILqBUhgzqZaYwmgd3roOlfRuWSMrL5XAbnr6PFDFzg3Rr8Xx+Du8CVQKD rIFw== X-Gm-Message-State: APjAAAVvOufzkFIHleCl52T3y/evBRpnWSTaRlS54Y5YhnmtU/tWiQho ZTgKLjfp7PdZPeu/CsjSUi3eg0Zu4MRodj2oAnI= X-Received: by 2002:a2e:9a01:: with SMTP id o1mr9309832lji.247.1578883406468; Sun, 12 Jan 2020 18:43:26 -0800 (PST) MIME-Version: 1.0 References: <20200103033929.4956-1-zhenzhong.duan@gmail.com> <20200109184055.GI5603@zn.tnic> <20200109204638.GA523773@rani.riverdale.lan> <20200110090032.GB19453@zn.tnic> In-Reply-To: <20200110090032.GB19453@zn.tnic> From: Zhenzhong Duan Date: Mon, 13 Jan 2020 10:43:14 +0800 Message-ID: Subject: Re: [PATCH v2] x86/boot/KASLR: Fix unused variable warning To: Borislav Petkov Cc: Arvind Sankar , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , "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 On Fri, Jan 10, 2020 at 5:00 PM Borislav Petkov wrote: > > On Fri, Jan 10, 2020 at 10:27:02AM +0800, Zhenzhong Duan wrote: > > Yes. Will you send this formally? > > And then a flood of fix-this-trivial-warning patches ensues? > > You should know that they have the lowest prio when it comes to looking > at them. I see. Just tried Arvind's patch, result is not that bad. Below are all warnings during build: In fact, only gop.c and kaslr.c have compile warning. /root/kernel/drivers/firmware/efi/libstub/gop.c: In function =E2=80=98efi_s= etup_gop=E2=80=99: /root/kernel/drivers/firmware/efi/libstub/gop.c:174:18: warning: =E2=80=98pixel_format=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:97:6: note: =E2=80=98pixel_format=E2=80=99 was declared here int pixel_format; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:166:45: warning: =E2=80=98fb_base=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] ext_lfb_base =3D (u64)(unsigned long)fb_base >> 32; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:95:6: note: =E2=80=98fb_bas= e=E2=80=99 was declared here u64 fb_base; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:174:18: warning: =E2=80=98pixels_per_scan_line=E2=80=99 may be used uninitialized in this fu= nction [-Wmaybe-uninitialized] setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:93:6: note: =E2=80=98pixels_per_scan_line=E2=80=99 was declared here u32 pixels_per_scan_line; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:163:17: warning: =E2=80=98height=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] si->lfb_height =3D height; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:92:13: note: =E2=80=98heigh= t=E2=80=99 was declared here u16 width, height; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:162:16: warning: =E2=80=98width=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] si->lfb_width =3D width; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:92:6: note: =E2=80=98width= =E2=80=99 was declared here u16 width, height; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:271:18: warning: =E2=80=98pixel_format=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:194:6: note: =E2=80=98pixel_format=E2=80=99 was declared here int pixel_format; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:263:45: warning: =E2=80=98fb_base=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] ext_lfb_base =3D (u64)(unsigned long)fb_base >> 32; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:192:6: note: =E2=80=98fb_ba= se=E2=80=99 was declared here u64 fb_base; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:271:18: warning: =E2=80=98pixels_per_scan_line=E2=80=99 may be used uninitialized in this fu= nction [-Wmaybe-uninitialized] setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:190:6: note: =E2=80=98pixels_per_scan_line=E2=80=99 was declared here u32 pixels_per_scan_line; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:260:17: warning: =E2=80=98height=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] si->lfb_height =3D height; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:189:13: note: =E2=80=98heig= ht=E2=80=99 was declared here u16 width, height; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:259:16: warning: =E2=80=98width=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] si->lfb_width =3D width; ^ /root/kernel/drivers/firmware/efi/libstub/gop.c:189:6: note: =E2=80=98width= =E2=80=99 was declared here u16 width, height; /root/kernel/arch/x86/boot/compressed/kaslr.c: In function =E2=80=98process= _mem_region=E2=80=99: /root/kernel/arch/x86/boot/compressed/kaslr.c:698:6: warning: unused variable =E2=80=98i=E2=80=99 [-Wunused-variable] int i; Regards Zhenzhong