Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144646
b: refs/heads/master
c: 57adc4d
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed May 6, 2009
1 parent 59be028 commit d428aab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 429aa0fca0df702fc9c81d799175a7d920398827
refs/heads/master: 57adc4d2dbf968fdbe516359688094eef4d46581
7 changes: 4 additions & 3 deletions trunk/include/asm-generic/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ struct bug_entry {
*/
#ifndef __WARN
#ifndef __ASSEMBLY__
extern void warn_slowpath(const char *file, const int line,
extern void warn_slowpath_fmt(const char *file, const int line,
const char *fmt, ...) __attribute__((format(printf, 3, 4)));
extern void warn_slowpath_null(const char *file, const int line);
#define WANT_WARN_ON_SLOWPATH
#endif
#define __WARN() warn_slowpath(__FILE__, __LINE__, NULL)
#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
#define __WARN() warn_slowpath_null(__FILE__, __LINE__)
#define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
#else
#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
#endif
Expand Down
13 changes: 10 additions & 3 deletions trunk/kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void oops_exit(void)
}

#ifdef WANT_WARN_ON_SLOWPATH
void warn_slowpath(const char *file, int line, const char *fmt, ...)
void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
{
va_list args;
char function[KSYM_SYMBOL_LEN];
Expand All @@ -356,7 +356,7 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
if (board)
printk(KERN_WARNING "Hardware name: %s\n", board);

if (fmt) {
if (*fmt) {
va_start(args, fmt);
vprintk(fmt, args);
va_end(args);
Expand All @@ -367,7 +367,14 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...)
print_oops_end_marker();
add_taint(TAINT_WARN);
}
EXPORT_SYMBOL(warn_slowpath);
EXPORT_SYMBOL(warn_slowpath_fmt);

void warn_slowpath_null(const char *file, int line)
{
static const char *empty = "";
warn_slowpath_fmt(file, line, empty);
}
EXPORT_SYMBOL(warn_slowpath_null);
#endif

#ifdef CONFIG_CC_STACKPROTECTOR
Expand Down

0 comments on commit d428aab

Please sign in to comment.