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 CEBF1C001B0 for ; Sun, 13 Aug 2023 14:30:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D2AC1869C0; Sun, 13 Aug 2023 16:27:46 +0200 (CEST) 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="T2Otw/F4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90F66869AB; Sun, 13 Aug 2023 16:27:44 +0200 (CEST) Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 8C15E847BC for ; Sun, 13 Aug 2023 16:27:42 +0200 (CEST) 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-io1-xd32.google.com with SMTP id ca18e2360f4ac-790cc395896so160929739f.1 for ; Sun, 13 Aug 2023 07:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691936861; x=1692541661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x4uaRB1HNv0+stYO07K+8iUGJoXBgmouPMwnQxKuaVY=; b=T2Otw/F4YokhScb1JDaRc49Z3s1PZG9wsGc5thNDnhRexpKEl+DG+JcRz4P5M1ttSV GspuIVfNEhe2bOoCQH1b55Z3dHLDHcYmFheor5xuXGpBXPJAqYwTMU4cbpzcVsvFZzyu 2CreKVeeOCtb2pj+ZwRWHHwhEuckUdSmS7svQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691936861; x=1692541661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x4uaRB1HNv0+stYO07K+8iUGJoXBgmouPMwnQxKuaVY=; b=LfdMX9JrIW2jTO5TnTB4Q4hQSsFjpP2c2oEezS/dnmw5A82F5tR9sNrWP0PrwS6By1 wOeuyGjpQ4sZWWK3+a7qeL4/PRVx5H67Y938WcQYaF0qQPsKBJ4E2T4cp8NVYSq7gK0/ ghxd5onkrq/prn77XS1vtsSR+gI52efA5GOk317+ECdiUPnr8jrLiZdO/DrP8uxCt5jl q0NFjHq//ZEWfJzPv0bYBc7RiJ2aZkj6jakBIyaZJcN1VjQ68PoNLPHJnqh1w+ylVUrK 4DYCOPz7mN/oU6LNd2pMs5dOYok4h6BeLBMdMkzQfHEQy1GONpfZbqLxjV4mHL9KX2He kXEg== X-Gm-Message-State: AOJu0YzaAVH8JPO5ciY1WinpTmXlDWA3cHnPnsO8yy8r+4tCPRVey6gI hrElC+HI9aDLE92kH8CpMyqaj+KppNEsDlbZ2Zc= X-Google-Smtp-Source: AGHT+IFmcRC6mWNdc+k+pQsyseD4kKeDCAaUmilJoRaLxtZIMsHV9AkWr+1iTh61JC5LmjdJQY9dcQ== X-Received: by 2002:a05:6e02:cb1:b0:349:8048:7bcc with SMTP id 17-20020a056e020cb100b0034980487bccmr7934215ilg.28.1691936861158; Sun, 13 Aug 2023 07:27:41 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id w7-20020a02cf87000000b00430cf006d9bsm2280952jar.30.2023.08.13.07.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 07:27:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng , Heinrich Schuchardt , Joshua Watt Subject: [PATCH 20/24] part: Add a fallback for part_get_bootable() Date: Sun, 13 Aug 2023 08:26:48 -0600 Message-ID: <20230813142708.361456-21-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230813142708.361456-1-sjg@chromium.org> References: <20230813142708.361456-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.8 at phobos.denx.de X-Virus-Status: Clean This function can be called when partition support is disabled. Add a static inline to handle this. Signed-off-by: Simon Glass --- include/part.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/part.h b/include/part.h index c3de317fcce8..5a6367a7c507 100644 --- a/include/part.h +++ b/include/part.h @@ -364,14 +364,6 @@ part_get_info_by_dev_and_name_or_num(const char *dev_iface, } #endif -/** - * part_get_bootable() - Find the first bootable partition - * - * @desc: Block-device descriptor - * @return first bootable partition, or 0 if there is none - */ -int part_get_bootable(struct blk_desc *desc); - struct udevice; /** * part_create_block_devices - Create block devices for disk partitions @@ -666,12 +658,24 @@ static inline struct part_driver *part_driver_get_first(void) */ int part_get_type_by_name(const char *name); +/** + * part_get_bootable() - Find the first bootable partition + * + * @desc: Block-device descriptor + * @return first bootable partition, or 0 if there is none + */ +int part_get_bootable(struct blk_desc *desc); + #else static inline int part_driver_get_count(void) { return 0; } static inline struct part_driver *part_driver_get_first(void) { return NULL; } + +static inline bool part_get_bootable(struct blk_desc *desc) +{ return false; } + #endif /* CONFIG_PARTITIONS */ #endif /* _PART_H */ -- 2.41.0.640.ga95def55d0-goog