Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp168411ybb; Thu, 19 Mar 2020 19:02:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsrDwEDJTeUCCyOPv/uSnbsfoXcKIqj7W+DJAPngkJs+4Fi3ba/YsoykSvMY9+QdM/zvuci X-Received: by 2002:a9d:a68:: with SMTP id 95mr4661743otg.87.1584669728562; Thu, 19 Mar 2020 19:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584669728; cv=none; d=google.com; s=arc-20160816; b=O8jsM0gGJaNmlONNI8mE4937/tN9hiGLnJqPi8g6sxZ+8CZPhemhUZNYYNdH4Xb9LN WsdyAC6eVjUocpX1ZdoelFTenLBA7i0QXrFxj5HpFPsRu2DalYMwhQPcS/bE7iffNVfJ 577Z0ZpCnRgmd8qlWrlCoAy3g4mhXgA2zV7OC8/G4R5ciWGLnhfJUvnMe/BQQ/b5KRma zwfRHNTgTIJPDGJ1tTIoun+4at7z0rrbbnDaMRRaUvseV29ZGwTet3xDzUbOCp5zXEiy 2XTNQzT6p57XLiTZIcXOzFZwc2/aDazOLyUCj09uC/mXqX/5gSOpeH0yhNr/38f6ETJu ubAg== 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=W439qqnj3amgmXthHTe3CXz0LpqU3anmtZjYuvrxKAY=; b=RmSIsntZFIlqMvzh/V6ghdkSehGqeIlD6bY/9gKfSaSkMspA3rxSmdfGduqBjWvKz0 ymHJZ96PIIAGaeZNa1BQgKwc+01I0hNfpEYZrxg40Zeb0nnKuX/zzjXfHLZHz5aCTVH+ josofqj+H6XsQu4x7Cf/Hi8SRfivWL4cH9lKNul8Z2LMVpBQ94PnW90vfMuA4GpsC4av YLiaTjb3V18zq2RmWlk9vM61jcEIbHPtjVD1qIcb562RfBwlfYXICAlrMbl7odygD3Hi 2FINC9MioOXu32UxD8yGkaYm6HxqVoG1UCv63GfjUNL/YyNxi7UOk3nCS8IXzq7+G3tc peCw== 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 96si2187916otn.253.2020.03.19.19.01.56; Thu, 19 Mar 2020 19:02:08 -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 S1727468AbgCTCAh (ORCPT + 99 others); Thu, 19 Mar 2020 22:00:37 -0400 Received: from mail-qv1-f67.google.com ([209.85.219.67]:41414 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727437AbgCTCAg (ORCPT ); Thu, 19 Mar 2020 22:00:36 -0400 Received: by mail-qv1-f67.google.com with SMTP id a10so2203906qvq.8; Thu, 19 Mar 2020 19:00:35 -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=W439qqnj3amgmXthHTe3CXz0LpqU3anmtZjYuvrxKAY=; b=k/p9CJssWApU0QgjDkFMF8uMJDY0YQ7uXxddqq/wyPfCvz5rEbvR93OL5qLiI9MwV9 k3MjE/zeJMwwZ731T9j52VjOmiuNxhWcAfOto163RkiJTZXYUIRBM9QGkW20RFJydzOW erNbKco/uZEmTFvJF/yuaKyJ3FxOb8FilZq/tUynt2oGlEhcnlm/kZ9cA//V/+BajClq nIXbq+acu9QvlgcPFfFR7RD1zF1uweqdUawclLgrbCKYP5eoOXSuclqB13VTDUXy4VAX rYUSAJ61mMhLtJrDAnPHuKmzpD2vpfj8W9jVzuT1/fyCNyU+e5BOBRuaU2KfGqg392GT NbXA== X-Gm-Message-State: ANhLgQ2i/KFv+GDbze2JUkdI2nnPU4TuxeZqm3UdaC8glickfI9bmuof hf7gRK2olAYnKqypKjn+j5ck5Brk X-Received: by 2002:a0c:eb8b:: with SMTP id x11mr6195704qvo.86.1584669634680; Thu, 19 Mar 2020 19:00:34 -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.33 (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 05/14] efi/gop: Slightly re-arrange logic of find_gop Date: Thu, 19 Mar 2020 22:00:19 -0400 Message-Id: <20200320020028.1936003-6-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 Small cleanup to get rid of conout_found. Signed-off-by: Arvind Sankar --- drivers/firmware/efi/libstub/gop.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c index 92abcf558845..a7d3efe36c78 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -99,7 +99,6 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles) for_each_efi_handle(h, handles, size, i) { efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; - bool conout_found = false; void *dummy = NULL; status = efi_bs_call(handle_protocol, h, proto, (void **)&gop); @@ -111,25 +110,22 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles) if (info->pixel_format == PIXEL_BLT_ONLY) continue; + /* + * Systems that use the UEFI Console Splitter may + * provide multiple GOP devices, not all of which are + * backed by real hardware. The workaround is to search + * for a GOP implementing the ConOut protocol, and if + * one isn't found, to just fall back to the first GOP. + * + * Once we've found a GOP supporting ConOut, + * don't bother looking any further. + */ status = efi_bs_call(handle_protocol, h, &conout_proto, &dummy); if (status == EFI_SUCCESS) - conout_found = true; - - if (!first_gop || conout_found) { - /* - * Systems that use the UEFI Console Splitter may - * provide multiple GOP devices, not all of which are - * backed by real hardware. The workaround is to search - * for a GOP implementing the ConOut protocol, and if - * one isn't found, to just fall back to the first GOP. - * - * Once we've found a GOP supporting ConOut, - * don't bother looking any further. - */ + return gop; + + if (!first_gop) first_gop = gop; - if (conout_found) - break; - } } return first_gop; -- 2.24.1