diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-25 15:26:28 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-09-11 23:59:47 -0400 |
commit | 83feeb195592b533541ff6399c8084e5b7c59677 (patch) | |
tree | c2aba50ec1f7744723b6ab9b0ba71c2f72ba7c4a /include | |
parent | 7d672f40941a549f72aa5500f9d32b26b3f6ab34 (diff) | |
download | lwn-83feeb195592b533541ff6399c8084e5b7c59677.tar.gz lwn-83feeb195592b533541ff6399c8084e5b7c59677.zip |
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 the return value of snprintf().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'include')
-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 9d1f5bb74dd5..58fb1f90eda5 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -24,8 +24,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); int parse_int_array_user(const char __user *from, size_t count, int **array); |