Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4526172ybv; Mon, 17 Feb 2020 00:38:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwIolSyiLpZf9MhpaMX2nP46exe6YLjIKE9Zwp5hHNcMsjja/OfOWVF+gJ4Vw7qQ/hjVZdV X-Received: by 2002:aca:3805:: with SMTP id f5mr9229989oia.6.1581928708470; Mon, 17 Feb 2020 00:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581928708; cv=none; d=google.com; s=arc-20160816; b=N7ckJtJxUpfw0dsUnhvUqpkOXCMR8T3zdteGcjOSPMihMGb5KqnqCIks8rQzb9jpbI z+7VB2bZfaC1H9rYe+q6Ad+RmV5tNe33aCQ/JLU9DUL8TcuSqHzthVvA22jKKFaalSZH pcz8k/mEcFumnp/A3FLTjQnzzmOSwMjLLVuJNJvBU/M9jLkNoJ2h602qZyWhjWP2H/AI JS6D4ToPq00b0XTI6A5oAaGKYscAzFx4GSLZjj903etHKZ1H7oDMZDZqhV9gDdO+vOAe BfCtB5ZTjQGVtypu+Xw8i3MyFcDonUaeNjn233RPXUoYtTnMhhW25BNcq24L/M4HQvh9 1+WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=X+HWS/WNS/dTpd9fgKtodPUnXqLG1EciZ1LXV4aXS48=; b=EiZQmu2fdsx/gI7L38i+D+FXZnMtrsfVEKAI/39T9RvpEam2eQJbW9/w0jaORkQnRi 7Y0hNBtCqlNUXrbkAHVDwcl3d/hLF0O+pHx3Ev3Ycl/cB0O4lDfuysLw3o8YbGRkhjSH t/N43ZKSSqMeMmqOIX8viS80NLy4vqMAEmH0F6hm1QwlbiW+K3YDDw9REsJKQVfF1s7S DifVn/oUvYjgPxkH2EwdR9Bv/zQJFHGGn7mf1mth9FikrmGwblgz/TW2IIov+W0RbrHM 9ReFbYJ7vgb3BGoRbKOuZkbpJC/DrLkhnyx0BRUrn+J9X/pCbYYQcBCYy0ywITPqbfoT Q+3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=almyo8lE; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si6997666otk.13.2020.02.17.00.38.16; Mon, 17 Feb 2020 00:38:28 -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=@kernel.org header.s=default header.b=almyo8lE; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728455AbgBQIh7 (ORCPT + 99 others); Mon, 17 Feb 2020 03:37:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:41010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728254AbgBQIh7 (ORCPT ); Mon, 17 Feb 2020 03:37:59 -0500 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B674F20725 for ; Mon, 17 Feb 2020 08:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581928679; bh=OEYEsnHiPG+bbDAtNq8Y3KYQGtuOQ7X4K6jfDlfmg0s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=almyo8lEtdGcW/YK6xiEN5YsP6IougXe95O345/6cpifswCPx3X2QySoktEEZrfmu vRhJgT/DSNEAivN5e3HnH1K1c1iU7YyhhkRicLieD5R+vAyfdWsCxMflhXHwKhr44K WPOVPoBKR4aFkHuHW0iVNjd2GESyBduUUOCABbn4= Received: by mail-wm1-f48.google.com with SMTP id g1so16179720wmh.4 for ; Mon, 17 Feb 2020 00:37:58 -0800 (PST) X-Gm-Message-State: APjAAAVr8jDh6FyJLTVgKfZlPQdzdpTx16kLEwHZRpuPXoZx9+tEsXpa tz41swk28eZ+YwzVpe2Vhp31IFZG4rxD2OeAOHpTYQ== X-Received: by 2002:a1c:bc46:: with SMTP id m67mr20340442wmf.40.1581928676930; Mon, 17 Feb 2020 00:37:56 -0800 (PST) MIME-Version: 1.0 References: <20200216184050.3100-1-xypron.glpk@gmx.de> In-Reply-To: <20200216184050.3100-1-xypron.glpk@gmx.de> From: Ard Biesheuvel Date: Mon, 17 Feb 2020 09:37:46 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] efi/libstub: simplify efi_get_memory_map() To: Heinrich Schuchardt Cc: linux-efi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 16 Feb 2020 at 19:40, Heinrich Schuchardt wrote: > > Do not check the value of status twice. > > Signed-off-by: Heinrich Schuchardt Thanks, I'll queue this one as well. > --- > drivers/firmware/efi/libstub/mem.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/firmware/efi/libstub/mem.c b/drivers/firmware/efi/libstub/mem.c > index c6a784ed640f..c25fd9174b74 100644 > --- a/drivers/firmware/efi/libstub/mem.c > +++ b/drivers/firmware/efi/libstub/mem.c > @@ -52,13 +52,14 @@ efi_status_t efi_get_memory_map(struct efi_boot_memmap *map) > goto again; > } > > - if (status != EFI_SUCCESS) > + if (status == EFI_SUCCESS) { > + if (map->key_ptr) > + *map->key_ptr = key; > + if (map->desc_ver) > + *map->desc_ver = desc_version; > + } else { > efi_bs_call(free_pool, m); > - > - if (map->key_ptr && status == EFI_SUCCESS) > - *map->key_ptr = key; > - if (map->desc_ver && status == EFI_SUCCESS) > - *map->desc_ver = desc_version; > + } > > fail: > *map->map = m; > -- > 2.25.0 >