Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp168479ybb; Thu, 19 Mar 2020 19:02:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vupt4NYlrSlldKzTtU5LzTBDDrWk2mVsmu4jkrPsEcmr3LuUmtsdXp5a2lOYlaTIMxv+hUu X-Received: by 2002:a05:6808:8:: with SMTP id u8mr4598701oic.37.1584669731619; Thu, 19 Mar 2020 19:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584669731; cv=none; d=google.com; s=arc-20160816; b=diC9OVJteLvTVr9Fj1+1I7VzBTTLwWOyCns9dLxaGm7yKrexgLPQJVuJt2aw0S6N3r cPbCKVk0POSGuDblxJIW/PRcP4b7R6AMaBEvNw2mQdGGr75mkGQ1UC7d9xHCOSVvva0r LTKySNc8UfsZ8bUO1y0I9W0Y7hW9xOca9sdcRfs9rqDalCICN3aETgrgqT7krD1PnSEQ 4+1bL3kX2G5lDCiiYAtmZVupQIL87pxYUFJqZf2fcqncx0NYIjeFg3Kh3YauTdjoyX8K b/aCnMmULBZCvC/l/r5uEPfdWKgvWISQuolLjkXwT5jgfF77dVcdr5MzGIdVgqiY5w6s UL5g== 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; bh=eyuZ8M8hTl4MaCMTYbXHyAXP3KMzGBIXaWWMgKU8ijQ=; b=IB8/trp49Y7ebEnV9qfaProR/t1efCGcc9oRmkp5oYQl/yM6XMAdQyQHQJkWcAjo8x aCPAkLSL18B3yR4ec7ysZ4JtjZmNPdTuo2ve23YYqHtfCZ+n9xJpF2lIZUyRmJjh30/1 mOaJgih7pXclvYLNHOEDUmI7MmI+dZJBnQj+bp8vSnsayWNOEMb59wBwj2m09cxUYPom TDJXtAeMArxI86K3VHSCOG+BOYR4wCRtE6GoK3nlDj0Yie0IuEX7cXFZiCtEQnD2qZm/ GRk66rgnFPHRBlYAZzfBDe+FMQwhIrK6FZ/XW4O+bKaTKoAViC+cKu6uSfM+RuA2bCvj 5lRg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si2052275oif.204.2020.03.19.19.02.00; Thu, 19 Mar 2020 19:02:11 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727657AbgCTCBP (ORCPT + 99 others); Thu, 19 Mar 2020 22:01:15 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34415 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727440AbgCTCAg (ORCPT ); Thu, 19 Mar 2020 22:00:36 -0400 Received: by mail-qk1-f194.google.com with SMTP id f3so5471887qkh.1; Thu, 19 Mar 2020 19:00:36 -0700 (PDT) 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=eyuZ8M8hTl4MaCMTYbXHyAXP3KMzGBIXaWWMgKU8ijQ=; b=bmWXNWwB8GtLQVdbJpZBZTdl3SMZvQJYTpUcxfTpTYBd1LFqKTv8BxecgmUQCs5GCY C9EthtWyk2AtmaWS2MLb692DY5r1b2ySQMPEMkPpCuHNcLikiII6OuIhNCmiIKwP5SAb ebJ4L1+X0lvLAIfFv2+2B2YM6UOrcphgr6gkQFs8zD7zOKmEAPzagRy7vbmwM6TE/Ybk 3Zp/UG3oS8zugsJglq2vn1r3hHISKjxj4UjsCO6hfRVevgKIzV2LTVtJnLvTwXbSyhHy nk2h7G3enIQY1JyP7fH3eUlRc7MvCp/nZOxOxtMG6bojaXN0zY8wdieD3w99sGgEmml8 bn+A== X-Gm-Message-State: ANhLgQ0jc6Sp6n4Nxzo+LwwmunKvFC73MtBhRFZAyAGCMRHXMo8yqTnD cw4xp93RWVu6TIyEyQRK4PI= X-Received: by 2002:a37:6411:: with SMTP id y17mr6065401qkb.437.1584669635482; Thu, 19 Mar 2020 19:00:35 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id n46sm3342198qtb.48.2020.03.19.19.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 19:00:34 -0700 (PDT) From: Arvind Sankar To: Ard Biesheuvel Cc: Hans de Goede , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/14] efi/gop: Move variable declarations into loop block Date: Thu, 19 Mar 2020 22:00:20 -0400 Message-Id: <20200320020028.1936003-7-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200319192855.29876-1-nivedita@alum.mit.edu> References: <20200319192855.29876-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Declare the variables inside the block where they're used. Get rid of a couple of redundant initializers. Signed-off-by: Arvind Sankar --- drivers/firmware/efi/libstub/gop.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c index a7d3efe36c78..0d195060a370 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -88,16 +88,19 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line, static efi_graphics_output_protocol_t * find_gop(efi_guid_t *proto, unsigned long size, void **handles) { - efi_graphics_output_protocol_t *gop, *first_gop; - efi_graphics_output_protocol_mode_t *mode; - efi_graphics_output_mode_info_t *info = NULL; - efi_status_t status; + efi_graphics_output_protocol_t *first_gop; efi_handle_t h; int i; first_gop = NULL; for_each_efi_handle(h, handles, size, i) { + efi_status_t status; + + efi_graphics_output_protocol_t *gop; + efi_graphics_output_protocol_mode_t *mode; + efi_graphics_output_mode_info_t *info; + efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; void *dummy = NULL; @@ -136,7 +139,7 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto, { efi_graphics_output_protocol_t *gop; efi_graphics_output_protocol_mode_t *mode; - efi_graphics_output_mode_info_t *info = NULL; + efi_graphics_output_mode_info_t *info; efi_physical_addr_t fb_base; gop = find_gop(proto, size, handles); -- 2.24.1