mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
string_helpers: Move string_is_valid() to the header
Move string_is_valid() to the header for wider use. While at it, rename to string_is_terminated() to be precise about its semantics. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20230208133153.22528-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a136391ae4
commit
f1db99c07b
2 changed files with 11 additions and 10 deletions
|
@ -11,6 +11,11 @@ struct device;
|
|||
struct file;
|
||||
struct task_struct;
|
||||
|
||||
static inline bool string_is_terminated(const char *s, int len)
|
||||
{
|
||||
return memchr(s, '\0', len) ? true : false;
|
||||
}
|
||||
|
||||
/* Descriptions of the types of units to
|
||||
* print in */
|
||||
enum string_size_units {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue