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 32BE4C4338F for ; Sat, 24 Jul 2021 15:04:46 +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 7975D60E9C for ; Sat, 24 Jul 2021 15:04:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7975D60E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 A5C0882E3F; Sat, 24 Jul 2021 17:04:43 +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="i55kInfj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D037082F3D; Sat, 24 Jul 2021 17:04:01 +0200 (CEST) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 F281082EEA for ; Sat, 24 Jul 2021 17:03:51 +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-x235.google.com with SMTP id u10so5396356oiw.4 for ; Sat, 24 Jul 2021 08:03:51 -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=glSna7GHccT+Pm9wYNPCi+qvcBfFFRbLyNbA7Cuy2iM=; b=i55kInfjfZ+tW1Kz6PmyhQBkPx4zLv+ffv1RQNqNPwK5gKjQnVh1+jMFKVA33iefiA 6bLp3RVP44GmwDvL/2roxoVQESiqksexi+Mx7rTggKxRdXOePf8galnVIO15o1td7oiD BuVAUyk0FnIHZlsJAH4eeQYDJ8wP9IczR+TUg= 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=glSna7GHccT+Pm9wYNPCi+qvcBfFFRbLyNbA7Cuy2iM=; b=JRXLa0rTd5GsH4e1c8PPVIOpFjCUfLCs++dWKcwyDPChrOlBOaszUBehHawYyGGm9q 5BGqnLuyHSkQPflO7WNESuEkClWMOi69oaPuemTWQzwV9uNpqtuy/ub19J6meD3Tnu6t 6XATXH1iA0gT1dOEQMCsr1Dj64yW793XF75zR135dfbjC/B7eQyasna7wG1nWCjvlOUe QAhUc+SBpGWr0IAIvEkmCiUw9Y8btQ5vxTibhK4SlyVXGdhq93CR1TTnRDdYGM6qaCx9 do/buud/6NfKbFUU9baB9kdpCwQ7rlKZBOVPGTXWl0YzPPfhRM1DxntmA/wEersnct6M hpVQ== X-Gm-Message-State: AOAM531oYdhZ1VgONnqDbuFdLBKlYmfv9Hw5bTwE2x80rp2adM/UUh8N yDvB3AFse6cUPLWgus+ZAJLxriaNmXF3D5UN X-Google-Smtp-Source: ABdhPJxrPVgZKYTBTiAfwRMzHJ/8wWLSH0NeXFzfyYk9evP+4t/gWhRXNQef7PCFiPz8t+Mp9zWxjg== X-Received: by 2002:aca:d7d5:: with SMTP id o204mr5885114oig.69.1627139030123; Sat, 24 Jul 2021 08:03:50 -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 w190sm6704082oif.17.2021.07.24.08.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 08:03:49 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , "Jonathan A . Kollasch" , Marek Vasut , Heinrich Schuchardt , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Eugeniu Rosca , Roland Gaudig , Stefan Herbrechtsmeier , Sean Anderson , Simon Glass Subject: [PATCH v2 04/14] lib: Comment the base parameter with simple_strtoul/l() Date: Sat, 24 Jul 2021 09:03:31 -0600 Message-Id: <20210724150341.243074-5-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog In-Reply-To: <20210724150341.243074-1-sjg@chromium.org> References: <20210724150341.243074-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 --- (no changes since v1) 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.432.gabb21c7263-goog