The patch titled vsprintf: factorize "(null)" string has been added to the -mm tree. Its filename is vsprintf-factorize-null-string.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: vsprintf: factorize "(null)" string From: André Goddard Rosa <andre.goddard@xxxxxxxxx> Change "<NULL>" to "(null)", unifying 3 equal strings. glibc also uses "(null)" for the same purpose. It decreases code size by 7 bytes: text data bss dec hex filename 15765 0 8 15773 3d9d vsprintf.o (ex lib/lib.a-BEFORE) 15758 0 8 15766 3d96 vsprintf.o (ex lib/lib.a-AFTER) Signed-off-by: André Goddard Rosa <andre.goddard@xxxxxxxxx> Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/vsprintf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN lib/vsprintf.c~vsprintf-factorize-null-string lib/vsprintf.c --- a/lib/vsprintf.c~vsprintf-factorize-null-string +++ a/lib/vsprintf.c @@ -546,12 +546,12 @@ static char *number(char *buf, char *end return buf; } -static char *string(char *buf, char *end, char *s, struct printf_spec spec) +static char *string(char *buf, char *end, const char *s, struct printf_spec spec) { int len, i; if ((unsigned long)s < PAGE_SIZE) - s = "<NULL>"; + s = "(null)"; len = strnlen(s, spec.precision); @@ -1498,7 +1498,7 @@ do { \ size_t len; if ((unsigned long)save_str > (unsigned long)-PAGE_SIZE || (unsigned long)save_str < PAGE_SIZE) - save_str = "<NULL>"; + save_str = "(null)"; len = strlen(save_str); if (str + len + 1 < end) memcpy(str, save_str, len + 1); _ Patches currently in -mm which might be from andre.goddard@xxxxxxxxx are linux-next.patch vsprintf-factorize-null-string.patch vsprintf-pre-calculate-final-string-length-for-later-use.patch vsprintf-give-it-some-care-to-please-checkpatchpl.patch vsprintf-use-tolower-whenever-possible.patch vsprintf-reduce-code-size-by-avoiding-extra-check.patch vsprintf-move-local-vars-to-block-local-vars-and-remove-unneeded-ones.patch vsprintf-factor-out-skip_space-code-in-a-separate-function.patch vsprintf-reuse-almost-identical-simple_strtoulx-functions.patch ctype-constify-read-only-_ctype-string.patch string-factorize-skip_spaces-and-export-it-to-be-generally-available.patch string-on-strstrip-first-remove-leading-spaces-before-running-over-str.patch tree-wide-convert-open-calls-to-remove-spaces-to-skip_spaces-lib-function.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html