diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-25 15:26:28 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-29 18:39:16 -0400 |
commit | 9786a90f5e4cefaf7ac14e757fb135048ef8302c (patch) | |
tree | 3ab77505491ef0758b8aaa51fdd3fd9c46c715db /include/linux/string_helpers.h | |
parent | f506d41978f1ea46feb6d2240dc14cd115ded6d5 (diff) |
lib/string_helpers: string_get_size() now returns characters wrote
printbuf now needs to know the number of characters that would have been
written if the buffer was too small, like snprintf(); this changes
string_get_size() to return the return value of snprintf().
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Andy Shevchenko <andy@kernel.org>
Acked-by: Andy Shevchenko <andy@kernel.org>
Diffstat (limited to 'include/linux/string_helpers.h')
-rw-r--r-- | include/linux/string_helpers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index c048eaec0894..ae4383f0fe7b 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -19,8 +19,8 @@ enum string_size_units { STRING_UNITS_2, /* use binary powers of 2^10 */ }; -void string_get_size(u64 size, u64 blk_size, enum string_size_units units, - char *buf, int len); +int string_get_size(u64 size, u64 blk_size, enum string_size_units units, + char *buf, int len); #define UNESCAPE_SPACE BIT(0) #define UNESCAPE_OCTAL BIT(1) |