From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0D28C433EF for ; Sun, 17 Oct 2021 15:36:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3B62A610E5 for ; Sun, 17 Oct 2021 15:36:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B62A610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 398B883173; Sun, 17 Oct 2021 17:36:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="k3WldKpG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A3AEF832EA; Sun, 17 Oct 2021 17:36:48 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4E87683173 for ; Sun, 17 Oct 2021 17:36:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D5CD60E74; Sun, 17 Oct 2021 15:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634485004; bh=WpId9gemHVAF1/H6ZG5zX/SzkZfGGSjJYu0xhavqxyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k3WldKpGRhBrZA4mGKX9v3A5P83C4uV/OveQ3gnI4UskEeoCu19hs7/2kY/TvShjv 2JPHJpHqOsGPLn8lYt92YUf7uJf3pLWdeuZdaL7uHnLqYNDRYWSlTWqamgOO7SZ/Fo 2fvI8bhzehfw/5LWHvZb5xNG/8LNjDTpGdTXmTT9sdPk1KiscThebqJ9+Zv7HlQYhy HIllYDTVVp70XtnE2rVTXNAed9JCfFT5IOeHNoe3OU9grXfwU2lzyzWMnbD5fFNq+u 7iYhBVqXrS9f/4CbSz9E/CMKSNlQ+p3Yxq/Ja4Ak8zTrkfvh5PLtzrIS3S00/BtI+u ZSV3PXc0lLbMw== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH v3 01/13] env: Fix documentation for env_get_f() Date: Sun, 17 Oct 2021 17:36:26 +0200 Message-Id: <20211017153638.29870-2-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211017153638.29870-1-kabel@kernel.org> References: <20211017153638.29870-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn This function actually returns: - the number of bytes written into @buf excluding the terminating NULL-byte, if there was enough space in @buf - the number of bytes written into @buf including the terminating NULL-byte, if there wasn't enough space in @buf - -1 if the variable is not found Signed-off-by: Marek BehĂșn Reviewed-by: Simon Glass --- include/env.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/env.h b/include/env.h index d5e2bcb530..b1a4003681 100644 --- a/include/env.h +++ b/include/env.h @@ -131,7 +131,10 @@ char *from_env(const char *envvar); * support reading the value (slowly) and some will not. * * @varname: Variable to look up - * @return value of variable, or NULL if not found + * @return number of bytes written into @buf, excluding the terminating + * NULL-byte if there was enough space in @buf, and including the + * terminating NULL-byte if there wasn't enough space, or -1 if the + * variable is not found */ int env_get_f(const char *name, char *buf, unsigned int len); -- 2.32.0