Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp107702ybb; Thu, 19 Mar 2020 12:30:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vstcmv3eSxEDadtVT2IdxvMSkZUMDpFKwvHDsYkx8bOwnIWEnANL5QzBwsG4Gv8QpA2LzPM X-Received: by 2002:aca:4bc5:: with SMTP id y188mr3714606oia.9.1584646250344; Thu, 19 Mar 2020 12:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584646250; cv=none; d=google.com; s=arc-20160816; b=DOsJCukuEriCEo8uKEgW5qHhjwmr+C1j1oExBgjb93eBmpf1C4YhmBPNSLEamuSGm9 E+INhglRHkfba+uhvvtMLYYwAUq5WYZjo9xOUIFPp7MD12mwHOYpxfvkHftFfQqN5huh fdaPoiFmpIY8O/AATF9jg2UiT1x5pR/r5wEhX7+EMuWokNojFh4bP6M8dWKLwOxtVK58 XF0NQ7q0wKGIKMOqgHOrDQb1/kngZW3qPUh8M4yAiEFU37nDt5sjilVFBmTjacil1x3/ TjF2Ew/U+N/9pBdilgdsIJNzr6RyoeAXQVE86BkXZSVD+QIu0a+Qghg7bkgzFyuGazlI U3DA== 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=Mc4mSVgEOL1QGaZrp02B0kG/g2C8JNCG3DgdQoZRRzyGbeNuwHFeR1tD3CYtEe3dXm BExL+c7OTyzc9nTS9F+9vm0qVXnnPXDrUXR9sqCeD7y165lYCoMnaGUyPLP6fIgechNO 7Po8vE2T7uycUkHPL2PIeZwgOlPcjzHwLkO5viEHyWSiol+pxdmu1AZ2RZIiz4VUIBtW vyuTjJu1hYkTx8MzxZy8/VZMTo078YHrW3n3xW30seppvigbefTNFuiUbkbhLhRerAJk 2kn/7TjxKc47HyACnWVzZpcFqpZtzSTg4VE+CQoip/uPkIKiZHWVLfyw8zRGyvu3B95j qHMg== 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 u135si1469045oif.248.2020.03.19.12.30.38; Thu, 19 Mar 2020 12:30:50 -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 S1728222AbgCST3t (ORCPT + 99 others); Thu, 19 Mar 2020 15:29:49 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35001 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbgCST3D (ORCPT ); Thu, 19 Mar 2020 15:29:03 -0400 Received: by mail-qk1-f196.google.com with SMTP id d8so4454382qka.2; Thu, 19 Mar 2020 12:29:03 -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=q9FUl+Yx+74dIMLFB5NNZv1hqvAOyB6l7YyS7FKqR7Bb9oxxHMMAGd2qlxyM3Yj5ke yvPQqdj1Xxe8czZ7i7qcDWU9N8Uk2dB6APJUDulWuty5LZzsm/M9dvtfry9x/MHZkK3q 1PGN4wHCi6qlyon1n/0yTh3XK6w0FJyUMbq0LWodUIaiIVwbuC8I741Xg5ffTtrdFaTL UYY81f1nGP2dnjTa7+WDeEnxKmpvqgxROy70DhBcGtFpxgq8HwNTLoPsYAoDVlhLTbmx m9USfFkGNHmk0y7C3KtICIuR6ykHmM9m6Bcx0PY0N5fmXdc+u7G7iESoWWy5gnUIOAce N8jQ== X-Gm-Message-State: ANhLgQ2a2o91G9z8OOXpwvQ64aW9M8MddxcJ9iTY4Sfk5nonLZwIXCss d5NG3oDPYDUAioW85gMSwsPd48oM X-Received: by 2002:a37:92c4:: with SMTP id u187mr4414343qkd.466.1584646142803; Thu, 19 Mar 2020 12:29:02 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id x89sm2292649qtd.43.2020.03.19.12.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 12:29:02 -0700 (PDT) From: Arvind Sankar To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/14] efi/gop: Move variable declarations into loop block Date: Thu, 19 Mar 2020 15:28:47 -0400 Message-Id: <20200319192855.29876-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