diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-06-17 16:48:40 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-06-17 16:48:40 +0800 |
commit | 72316324660f953a8daee9bf9fcf942f7851b516 (patch) | |
tree | 9028408e487d044ae73ca0121a4af2855070545b /lib | |
parent | e91b1cc90283c1b9b75670b027a18afbd20fe070 (diff) | |
parent | 7c0ca54c030093b1d887c432304414d269a9504c (diff) |
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-rt
Conflicts:
include/linux/cgroup.h
compatible with 28f83d2 futex: Handle unlock_pi race gracefull
in kernel/futex.c
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dma-debug.c | 2 | ||||
-rw-r--r-- | lib/string.c | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 3e0ea4520fc9..19c146612974 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -657,9 +657,9 @@ static struct dma_debug_entry *dma_entry_alloc(void) spin_lock_irqsave(&free_entries_lock, flags); if (list_empty(&free_entries)) { - pr_err("DMA-API: debugging out of memory - disabling\n"); global_disable = true; spin_unlock_irqrestore(&free_entries_lock, flags); + pr_err("DMA-API: debugging out of memory - disabling\n"); return NULL; } diff --git a/lib/string.c b/lib/string.c index bb3d4b6993c4..13d1e84ddb80 100644 --- a/lib/string.c +++ b/lib/string.c @@ -849,3 +849,20 @@ void *memchr_inv(const void *start, int c, size_t bytes) return check_bytes8(start, value, bytes % 8); } EXPORT_SYMBOL(memchr_inv); + +/** + * strreplace - Replace all occurrences of character in string. + * @s: The string to operate on. + * @old: The character being replaced. + * @new: The character @old is replaced with. + * + * Returns pointer to the nul byte at the end of @s. + */ +char *strreplace(char *s, char old, char new) +{ + for (; *s; ++s) + if (*s == old) + *s = new; + return s; +} +EXPORT_SYMBOL(strreplace); |