From patchwork Wed Aug 21 10:58:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 820952 Delivered-To: patch@linaro.org Received: by 2002:adf:e98a:0:b0:367:895a:4699 with SMTP id h10csp639041wrm; Wed, 21 Aug 2024 03:59:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUlHPP8RI5AbfoNY6WskKNWYvkplLsoR88ym+Zwmi8HLDzpICrXChFKCfZeNDntLQDeTOXSFw==@linaro.org X-Google-Smtp-Source: AGHT+IEFuUUKgE4UusrCG4lZYo79CcQub4IY8PjYnkl5QkSvBwioon41wC3DpaEVwiMALm/s0MNF X-Received: by 2002:a05:6512:3a94:b0:533:4505:5b2a with SMTP id 2adb3069b0e04-53348592586mr1767827e87.28.1724237956717; Wed, 21 Aug 2024 03:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724237956; cv=none; d=google.com; s=arc-20160816; b=JteyndRHVKCcncIXJla6MNelcWfsYRkmBCnvBwqdoCwYdqXB2+nC43D89TLdUVXvbl s0eunHTI60vbFvmwJ++N34rksy6XiPBgrmO9H+fcD+wqPZvcxg8xlrkDDwwJXT1hNRsx E1j1dmDRKhtwMN+SJDjJzk11wlYhzyAdHiwDRdjICZY0Lockn6QlaZWBXXDQLXJB7FTR uU0K5hFN9pkrYH8SCkO3OWeDtwEaAyjaVIRWbTr2YYBtaIWJ4zgkUZ9TjWUMlQsuY8GI SDLe1wgYSwVdovrSQXCQQJ3AHlfvvdeLHvKRoVSVeB3kULdq4RCI1qjLlQC9EQSvCk4y HWBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=J3TR0/KkIqfDi60vEG+wcXKjTcxtdNrVb5MvUA7LqoU=; fh=pnMZGD6unUPoMrkOwzXlkuYg+kVwGnSNRCTlQoWqjVc=; b=cRSA4D22qVjhdyqKabJ61xsLKZWTi3zba1IV90Kg1VPe7E/47acLj9eBoSDEqmFxvZ 7bpD66sDM8RSmTmj8Y6tZa3B+Bk/ElE0VOydL5TELsOXSI3Wh0uyEudaS7GfoZIWEWaa 6Kc2RmkWO/c/cDiYJRDtscn4ldU98VINTm4tV7QwDZOluogTZP2heoNkZv42XPttwF75 CaLUpXlXg9+ANXb5h1MS1RyfH8f7CLR6BDRKSVmT6L3bsVMwxYyF1FRiQ2gg3igQS1v8 5XZplS3C+zE+35YMh1nYXf8+yPOU6Ir3Fuj67R/wdCqHYm4GW7ST7APr4CXGrAjcETq7 TXeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a83838c8b4esi824045566b.144.2024.08.21.03.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 03:59:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DF7888B52; Wed, 21 Aug 2024 12:59:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 70DC188C04; Wed, 21 Aug 2024 12:59:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id ACAFF88C20 for ; Wed, 21 Aug 2024 12:59:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3734BDA7; Wed, 21 Aug 2024 03:59:27 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C9EB43F73B; Wed, 21 Aug 2024 03:58:57 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Sughosh Ganu Subject: [PATCH v3 01/27] alist: add a helper to check if the list is full Date: Wed, 21 Aug 2024 16:28:13 +0530 Message-Id: <20240821105839.2870293-2-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240821105839.2870293-1-sughosh.ganu@linaro.org> References: <20240821105839.2870293-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 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 Add a helper function to check if the alist is full. This can then be used to extend the alist. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V2: None include/alist.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/alist.h b/include/alist.h index 586a1efa5c..68d268f01a 100644 --- a/include/alist.h +++ b/include/alist.h @@ -82,6 +82,17 @@ static inline bool alist_err(struct alist *lst) return lst->flags & ALISTF_FAIL; } +/** + * alist_full() - Check if the alist is full + * + * @lst: List to check + * Return: true if full, false otherwise + */ +static inline bool alist_full(struct alist *lst) +{ + return lst->count == lst->alloc; +} + /** * alist_get_ptr() - Get the value of a pointer *