Revert "printk: create pr_<level> functions"

This reverts commit 874f9c7da9.

Geert Uytterhoeven reports:
 "This change seems to have an (unintendent?) side-effect.

  Before, pr_*() calls without a trailing newline characters would be
  printed with a newline character appended, both on the console and in
  the output of the dmesg command.

  After this commit, no new line character is appended, and the output
  of the next pr_*() call of the same type may be appended, like in:

    - Truncating RAM at 0x0000000040000000-0x00000000c0000000 to -0x0000000070000000
    - Ignoring RAM at 0x0000000200000000-0x0000000240000000 (!CONFIG_HIGHMEM)
    + Truncating RAM at 0x0000000040000000-0x00000000c0000000 to -0x0000000070000000Ignoring RAM at 0x0000000200000000-0x0000000240000000 (!CONFIG_HIGHMEM)"

Joe Perches says:
 "No, that is not intentional.

  The newline handling code inside vprintk_emit is a bit involved and
  for now I suggest a revert until this has all the same behavior as
  earlier"

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Requested-by: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds
2016-08-09 10:48:18 -07:00
parent 84bd8d33a9
commit a0cba2179e
4 ha cambiato i file con 26 aggiunte e 76 eliminazioni

Vedi File

@@ -1930,26 +1930,7 @@ asmlinkage int printk_emit(int facility, int level,
}
EXPORT_SYMBOL(printk_emit);
#define define_pr_level(func, loglevel) \
asmlinkage __visible void func(const char *fmt, ...) \
{ \
va_list args; \
\
va_start(args, fmt); \
vprintk_default(loglevel, fmt, args); \
va_end(args); \
} \
EXPORT_SYMBOL(func)
define_pr_level(__pr_emerg, LOGLEVEL_EMERG);
define_pr_level(__pr_alert, LOGLEVEL_ALERT);
define_pr_level(__pr_crit, LOGLEVEL_CRIT);
define_pr_level(__pr_err, LOGLEVEL_ERR);
define_pr_level(__pr_warn, LOGLEVEL_WARNING);
define_pr_level(__pr_notice, LOGLEVEL_NOTICE);
define_pr_level(__pr_info, LOGLEVEL_INFO);
int vprintk_default(int level, const char *fmt, va_list args)
int vprintk_default(const char *fmt, va_list args)
{
int r;
@@ -1959,7 +1940,7 @@ int vprintk_default(int level, const char *fmt, va_list args)
return r;
}
#endif
r = vprintk_emit(0, level, NULL, 0, fmt, args);
r = vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, 0, fmt, args);
return r;
}
@@ -1992,7 +1973,7 @@ asmlinkage __visible int printk(const char *fmt, ...)
int r;
va_start(args, fmt);
r = vprintk_func(LOGLEVEL_DEFAULT, fmt, args);
r = vprintk_func(fmt, args);
va_end(args);
return r;