Commit 58eeba0b authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Andy Shevchenko

lib/string_helpers: Introduce string_upper() and string_lower() helpers

Provide the helpers for string conversions to upper and lower cases.
Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 19206a1e
......@@ -2,6 +2,7 @@
#ifndef _LINUX_STRING_HELPERS_H_
#define _LINUX_STRING_HELPERS_H_
#include <linux/ctype.h>
#include <linux/types.h>
struct file;
......@@ -75,6 +76,20 @@ static inline int string_escape_str_any_np(const char *src, char *dst,
return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only);
}
static inline void string_upper(char *dst, const char *src)
{
do {
*dst++ = toupper(*src);
} while (*src++);
}
static inline void string_lower(char *dst, const char *src)
{
do {
*dst++ = tolower(*src);
} while (*src++);
}
char *kstrdup_quotable(const char *src, gfp_t gfp);
char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp);
char *kstrdup_quotable_file(struct file *file, gfp_t gfp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment