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 A81EDC433EF for ; Sat, 22 Jan 2022 01:17:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D97D98378B; Sat, 22 Jan 2022 02:17:15 +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="URypa436"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65D888302D; Sat, 22 Jan 2022 02:17:06 +0100 (CET) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 1E82F830B9 for ; Sat, 22 Jan 2022 02:17:03 +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-x136.google.com with SMTP id i14so9026297ila.11 for ; Fri, 21 Jan 2022 17:17:03 -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=131qIoWuFNU9DJsCVM6vrU7RGhHkVDzBgNRTXPtVHNI=; b=URypa4365aQ1To/nOQdnmNftdR5KGzNcgDtomUmukMAk53V0dFYxJ+wkfCttvmhM8Z F+/HK7ecFdyhPPZo2OB30SbdJbFyxiTZ+XjDK6d/1NOfM5yEJCL77qfpSOofoNk4lrTV wrR5f+orhOWEc0nK7UIW3jInwdfOXj/SbeUI8= 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=131qIoWuFNU9DJsCVM6vrU7RGhHkVDzBgNRTXPtVHNI=; b=T/sF/QZrkCnmNu5VJI5oWw523V9S4WzJ7pq08f+EKKCpP4CKxN4tQtLVlexs+ROomW L+WuGLzrlOg+tEmk6cUi6EwjyT64rwh5i6b4w5ANN4WdHQ0yyDuEOfDewwKueMiKQIBN WzNJryUUxTwrFZUmKt2qYc+wlcTdCM9F3uQAh4YAXy34QoUL+Q+TTaCHO0U/hNITtlJg vKrMLntwN/0bqfGCJBmfGKgyMZQa686rscJWMHwEIVfh3IWf/KSCv0CcqqzoPlJAPUo/ 53/sJmRvn9FDZ6pBc2FSA0Y8IK/d3BvjiXBBAZ301mku9Wjm9o0335+u1bkDkW74dWnG c2aw== X-Gm-Message-State: AOAM533U4mVMGX1Vr2B5OcFKUn4wxmcZUqgCU4jFDboXfya4zHRwPXbo kV3GFNxJFvlUZIxrh/za6BgszjsKnSPTFQ== X-Google-Smtp-Source: ABdhPJzDdr+Mx4pZ3HCTA5bBISj7MrnESLKXL061SmQYvYYj89mcaZeN+V8Nqg/3BAwA7tOhtKFJ2A== X-Received: by 2002:a92:7f02:: with SMTP id a2mr3537306ild.238.1642814221763; Fri, 21 Jan 2022 17:17:01 -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 p4sm2424551iod.37.2022.01.21.17.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 17:17:01 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Simon Glass , Alexander Graf Subject: [PATCH 3/3] efi: Drop unnecessary calls to blk_find_device() Date: Fri, 21 Jan 2022 18:16:56 -0700 Message-Id: <20220122011656.2724166-3-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220122011656.2724166-1-sjg@chromium.org> References: <20220122011656.2724166-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 --- 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 a838a32b810..f415741d528 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -768,13 +768,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 */ @@ -865,13 +860,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.rc0.227.g00780c9af4-goog