Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20145C433F5 for ; Sat, 29 Jan 2022 21:59:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89998836BF; Sat, 29 Jan 2022 22:58:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cVzKyJiS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 632E0834CB; Sat, 29 Jan 2022 22:58:49 +0100 (CET) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B097B834CB for ; Sat, 29 Jan 2022 22:58:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id i1so8471178ils.5 for ; Sat, 29 Jan 2022 13:58:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3gYckQEWwn+IN429MEXztcvfoYPxEsVmq57cib1CYOc=; b=cVzKyJiSk/jxFp4+E4GOb84kZ1Nri3Q8Ds34RNoQRaaaDRMe4UdtREESy70P2xwZrx kXIVurgG1fldsugRlL3nTtUO1Rzkxqb9kigvkKtRnPEpwUi4Qmnf2mjJ5ifIkkJi9Nu1 NTYtFCATR9Qx4rmSCTbqmA6BPI7aFqLbZqEJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3gYckQEWwn+IN429MEXztcvfoYPxEsVmq57cib1CYOc=; b=HyPqZ85l3bskhpXxQF38PCtnLPZfmoArwvuDWzo5CTFm6Mqw0pecUlBYa2Eln+sEGI d6esTMyMAJqoSr7s7M7hos9HAFxFVCPPD7HecuQv18ETLPbS2qnWVDTi0q1W314U7Vft RGyd+1VqvUDPdP+xQuC9wdIfIDjjNhN9v9eSps7bhup+boGW1KfhQkTPgX06yjTHpJvb C18cgaaDZm4PRibty3IpXZMLWJiDoNlGxSOW79PFa5ffoNo1Y6j1TNnVgU7T8NwME86Y hIBxnLAQ37OoEUvoIjyveC9Wq1VNYw6BPt301+ZuoAE4b0OtTY2GmoDPGwYDQ5A8+kA7 biqg== X-Gm-Message-State: AOAM533+ChHLw+LKYnp9bhN0R+jlib8WA34AswD4xeuTVy76kDF4l2pR +K3dSqQHTxyeQF4K8M5GJGxko98oBxBUvA== X-Google-Smtp-Source: ABdhPJwDCUKxUQh2IH+vK2Ggo/eXrYmaOf3vnY11V32Fn1cuY/BhqFazeTaH0uUqWS38LI5D72bBCg== X-Received: by 2002:a05:6e02:1d15:: with SMTP id i21mr5355314ila.246.1643493523324; Sat, 29 Jan 2022 13:58:43 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id o11sm15693953ilm.20.2022.01.29.13.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 13:58:43 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Simon Glass , Alexander Graf Subject: [PATCH v2 3/3] efi: Drop unnecessary calls to blk_find_device() Date: Sat, 29 Jan 2022 14:58:39 -0700 Message-Id: <20220129215839.535809-3-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.rc2.247.g8bbb082509-goog In-Reply-To: <20220129215839.535809-1-sjg@chromium.org> References: <20220129215839.535809-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean When we have the block descriptor we can simply access the device. Drop the unnecessary function call. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/efi_device_path.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 75ab4de7070..dc787b4d3dd 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -769,13 +769,8 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) static unsigned dp_part_size(struct blk_desc *desc, int part) { unsigned dpsize; - struct udevice *dev; - int ret; + struct udevice *dev = desc->bdev; - ret = blk_find_device(desc->if_type, desc->devnum, &dev); - - if (ret) - dev = desc->bdev->parent; dpsize = dp_size(dev); if (part == 0) /* the actual disk, not a partition */ @@ -866,13 +861,8 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part) */ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) { - struct udevice *dev; - int ret; - - ret = blk_find_device(desc->if_type, desc->devnum, &dev); + struct udevice *dev = desc->bdev; - if (ret) - dev = desc->bdev->parent; buf = dp_fill(buf, dev); if (part == 0) /* the actual disk, not a partition */ -- 2.35.0.rc2.247.g8bbb082509-goog