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 X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA887C07E95 for ; Tue, 20 Jul 2021 13:30:35 +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 2103B61106 for ; Tue, 20 Jul 2021 13:30:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2103B61106 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA2CE82C7C; Tue, 20 Jul 2021 15:30:32 +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="lLxcGlJK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 76E0F82C7C; Tue, 20 Jul 2021 15:30:10 +0200 (CEST) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 99BEF82C54 for ; Tue, 20 Jul 2021 15:29:54 +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-oi1-x229.google.com with SMTP id r80so10724304oie.13 for ; Tue, 20 Jul 2021 06:29:54 -0700 (PDT) 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=WL2Ub1mVe4959ITCNwhad3Dks/t82UyG7rAdbAgee3c=; b=lLxcGlJKrXvvYsJkHIMF/sHMsuS+7pD9M7jMX3aWvblnpD7WEUPvRK3BVT7hGqIrdl DOpKKmjatCHnE6hle5pUhgnco+SNtE0faLUKCiqVV+S+VaQzlnrDL8sLcrg2k0NdwqZ3 ezbCF0LPi7M5y1Y91xdjQ5dvsxE1eveaVH4+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WL2Ub1mVe4959ITCNwhad3Dks/t82UyG7rAdbAgee3c=; b=O5EvmmOBNeK0QFEzp3E/dAdcTG1NQceG8GLWS9mqCzz8C5BRnzk7jAdpJ1EwAb6u0U kCkQ3p/s2aKxAD5tE4NRTpHhsbXjm7YUJCy3Pv7/IxT/2cioEiEGvBRBf2XJ0SpUtSkr zCDvkAzveJISQ3CmdCbosbblo/7wCsz2r1iiedLwLjcfaQKmQYMQGc+LxQXf/7OW1Pl+ t96KEMCjERM7+4jvpPe1tRLPdG1NV4SH4a++OCAAVHLBRFjIqSzbYLkklPGFSdk/61fT P8Rwss7vJ2jX5Rk0hTwgv0/3ui4a2miOliuQZ7vjihbVR2O341uMkDXoQGcy04nEuCGk C2YA== X-Gm-Message-State: AOAM5322yfXdzMHBYEbpw5EdCCex7KsUd8kubtXWy7bLU9MVmPas6KSB hkRI9A+q7M/UlpgCL8lPW1cAlWpVEIjT7ozd X-Google-Smtp-Source: ABdhPJxqVYXryfKUS/VGQNGr8hFQ1qt2mvKXxevrmMZzsuh6nIDKHPd4V1hQDNxnxoKhVFg58xQMmg== X-Received: by 2002:aca:1c17:: with SMTP id c23mr10447160oic.75.1626787793041; Tue, 20 Jul 2021 06:29:53 -0700 (PDT) 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 w64sm4239299otb.45.2021.07.20.06.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 06:29:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Eugeniu Rosca , Roland Gaudig , Heinrich Schuchardt , Stefan Herbrechtsmeier , Sean Anderson , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Tom Rini , Marek Vasut , Simon Glass Subject: [PATCH 04/15] lib: Comment the base parameter with simple_strtoul/l() Date: Tue, 20 Jul 2021 07:29:28 -0600 Message-Id: <20210720132940.1171011-5-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog In-Reply-To: <20210720132940.1171011-1-sjg@chromium.org> References: <20210720132940.1171011-1-sjg@chromium.org> MIME-Version: 1.0 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 This parameter is not documented properly since it does not cover the meaning when the base is 0. Update this in both functions. Signed-off-by: Simon Glass --- include/vsprintf.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/vsprintf.h b/include/vsprintf.h index 2b0e15f84a3..0e112b5d5ba 100644 --- a/include/vsprintf.h +++ b/include/vsprintf.h @@ -15,12 +15,15 @@ * * @param cp The string to be converted * @param endp Updated to point to the first character not converted - * @param base The number base to use + * @param base The number base to use (0 for the default) * @return value decoded from string (0 if invalid) * * Converts a string to an unsigned long. If there are invalid characters at * the end these are ignored. In the worst case, if all characters are invalid, * 0 is returned + * + * If @base is 0, octal or hex prefixes are supported (e.g. 0777, 0x123) to + * select a particular base. By default decimal is used. */ ulong simple_strtoul(const char *cp, char **endp, unsigned int base); @@ -53,7 +56,7 @@ unsigned long dectoul(const char *cp, char **endp); /** * strict_strtoul - convert a string to an unsigned long strictly * @param cp The string to be converted - * @param base The number base to use + * @param base The number base to use (0 for the default) * @param res The converted result value * @return 0 if conversion is successful and *res is set to the converted * value, otherwise it returns -EINVAL and *res is set to 0. @@ -68,6 +71,9 @@ unsigned long dectoul(const char *cp, char **endp); * * echo will append a newline to the tail. * + * If @base is 0, octal or hex prefixes are supported (e.g. 0777, 0x123) to + * select a particular base. By default decimal is used. + * * Copied this function from Linux 2.6.38 commit ID: * 521cb40b0c44418a4fd36dc633f575813d59a43d * -- 2.32.0.402.g57bb445576-goog