summaryrefslogtreecommitdiffstats
path: root/include/vsprintf.h
Commit message (Collapse)AuthorAgeFilesLines
* lib: sscanf: add sscanf implementationAndrii Anisov2020-08-141-0/+8
| | | | | | | | | Port sscanf implementation from mini-os and introduce new Kconfig option to enable it: CONFIG_SSCANF. Disable by default. Signed-off-by: Andrii Anisov <andrii_anisov@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
* lib: Add a function to convert a string to upper caseSimon Glass2020-04-241-0/+12
| | | | | | | | Add a helper function for this operation. Update the strtoul() tests to check upper case as well. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Move strtomhz() to vsprintf.hSimon Glass2019-12-021-0/+10
| | | | | | | | | | | At present this function sits in its own file but it does not really justify it. There are similar string functions in vsprintf.h, so move it there. Also add the missing function comment. Use the vsprintf.h include file explicitly where needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* vsprintf.h: include <linux/types.h>Masahiro Yamada2017-10-041-0/+1
| | | | | | | This header uses ulong, size_t, loff_t. Include <linux/types.h> to make this header self-contained. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* vsprintf: vsprintf does not have parameter sizeHeinrich Schuchardt2017-09-071-3/+1
| | | | | | | | | The inline documentation of vsprintf mentions a parameter size which does not exist in the function declaration. int vsprintf(char *buf, const char *fmt, va_list args); Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Fix spelling of "resetting".Vagrant Cascadian2016-10-311-2/+2
| | | | | | | | Cover-Letter: Fixes several spelling errors for the words "resetting", "extended", "occur", and "multiple". Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* vsprintf: Include stdarg for va_listMaxime Ripard2016-08-201-0/+2
| | | | | | | | | | | | vsprintf.h doesn't include the stdarg.h file, which means that it relies on the files that include vsprintf.h to include stdarg.h as well. Add an explicit include to avoid build errors when simply including that file. Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* vsprintf.c: Always enable CONFIG_SYS_VSNPRINTFTom Rini2016-01-191-12/+0
| | | | | | | | | | | | | | Enabling this function always removes some class of string saftey issues. The size change here in general is about 400 bytes and this seems a reasonable trade-off. Cc: Peng Fan <peng.fan@nxp.com> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Adrian Alonso <aalonso@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* lib: Add function to extract a number from the end of a stringSimon Glass2015-07-211-0/+26
| | | | | | | Split out the code in fdtdec which finds a number at the end of a string. It can be useful in other situations. Signed-off-by: Simon Glass <sjg@chromium.org>
* mtd, nand: Move common functions from cmd_nand.c to common placeHeiko Schocher2015-06-301-0/+2
| | | | | | | | | | | | | | Move common functions from cmd_nand.c (for calculating offset and size from cmdline paramter) to common place, so they could used from other commands which use mtd partitions. For onenand the arg_off_size() is left in common/cmd_onenand.c. It should use now the common arg_off() function, but as I could not test onenand I let it there ... Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
* dm: Add a panic_str() function to reduce code sizeSimon Glass2015-04-231-0/+23
| | | | | | | | The printf() in panic() adds about 1.5KB of code size to SPL when compiled with Thumb-2. Provide a smaller version that does not support printf()-style arguments and use it in two commonly compiled places. Signed-off-by: Simon Glass <sjg@chromium.org>
* Coding Style cleanup: remove trailing white spaceWolfgang Denk2013-10-141-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Add function to print a number with grouped digitsSimon Glass2013-06-261-0/+11
| | | | | | | Move bootstage's numbering printing code into a generic place so that it can be used by tracing also. Signed-off-by: Simon Glass <sjg@chromium.org>
* vsprintf: Move function documentation into header fileSimon Glass2011-12-171-0/+123
| | | | | | | Now that this is not in common.h, perhaps it is acceptable to move this documentation into the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add safe vsnprintf and snprintf library functionsSonny Rao2011-12-171-0/+19
| | | | | | | | | | | | | | | | From: Sonny Rao <sonnyrao@chromium.org> These functions are useful in U-Boot because they allow a graceful failure rather than an unpredictable stack overflow when printf() buffers are exceeded. Mostly copied from the Linux kernel. I copied vscnprintf and scnprintf so we can change printf and vprintf to use the safe implementation but still return the correct values. (Simon Glass <sjg@chromium.org> modified this commit a little) Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
* Move vsprintf functions into their own headerSimon Glass2011-12-171-0/+39
common.h is very large, so before changing the vsprintf functions, move the prototypes into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>