summaryrefslogtreecommitdiff
path: root/include/linux/string_helpers.h
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-04-16 02:17:25 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-16 02:35:23 +0300
commit3aeddc7d665e41b1ba193f5c427ca52086d085ae (patch)
tree7f00129aa094227adc55ee92cc585f039a747fe5 /include/linux/string_helpers.h
parent9c98f2359600386efd1c6adfabc5a04118a79798 (diff)
downloadlinux-3aeddc7d665e41b1ba193f5c427ca52086d085ae.tar.xz
lib/string_helpers.c: refactor string_escape_mem
When printf is given the format specifier %pE, it needs a way of obtaining the total output size that would be generated if the buffer was large enough, and string_escape_mem doesn't easily provide that. This is a refactorization of string_escape_mem in preparation of changing its external API to provide that information. The somewhat ugly early returns and subsequent seemingly redundant conditionals are to make the following patch touch as little as possible in string_helpers.c while still preserving the current behaviour of never outputting partial escape sequences. That behaviour must also change for %pE to work as one expects from every other printf specifier. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/string_helpers.h')
0 files changed, 0 insertions, 0 deletions