Commit d1f1052c authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

device: Change dev_<level> logging functions to return void

No caller or macro uses the return value so make all
the functions return void.

Compiled x86 allyesconfig and defconfig w/o CONFIG_PRINTK
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a2a15d54
...@@ -2080,54 +2080,47 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) ...@@ -2080,54 +2080,47 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
} }
EXPORT_SYMBOL(dev_printk_emit); EXPORT_SYMBOL(dev_printk_emit);
static int __dev_printk(const char *level, const struct device *dev, static void __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf) struct va_format *vaf)
{ {
if (!dev) if (dev)
return printk("%s(NULL device *): %pV", level, vaf); dev_printk_emit(level[1] - '0', dev, "%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
return dev_printk_emit(level[1] - '0', dev, else
"%s %s: %pV", printk("%s(NULL device *): %pV", level, vaf);
dev_driver_string(dev), dev_name(dev), vaf);
} }
int dev_printk(const char *level, const struct device *dev, void dev_printk(const char *level, const struct device *dev,
const char *fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
int r;
va_start(args, fmt); va_start(args, fmt);
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
r = __dev_printk(level, dev, &vaf); __dev_printk(level, dev, &vaf);
va_end(args); va_end(args);
return r;
} }
EXPORT_SYMBOL(dev_printk); EXPORT_SYMBOL(dev_printk);
#define define_dev_printk_level(func, kern_level) \ #define define_dev_printk_level(func, kern_level) \
int func(const struct device *dev, const char *fmt, ...) \ void func(const struct device *dev, const char *fmt, ...) \
{ \ { \
struct va_format vaf; \ struct va_format vaf; \
va_list args; \ va_list args; \
int r; \
\ \
va_start(args, fmt); \ va_start(args, fmt); \
\ \
vaf.fmt = fmt; \ vaf.fmt = fmt; \
vaf.va = &args; \ vaf.va = &args; \
\ \
r = __dev_printk(kern_level, dev, &vaf); \ __dev_printk(kern_level, dev, &vaf); \
\ \
va_end(args); \ va_end(args); \
\
return r; \
} \ } \
EXPORT_SYMBOL(func); EXPORT_SYMBOL(func);
......
...@@ -1038,22 +1038,22 @@ extern __printf(3, 4) ...@@ -1038,22 +1038,22 @@ extern __printf(3, 4)
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
extern __printf(3, 4) extern __printf(3, 4)
int dev_printk(const char *level, const struct device *dev, void dev_printk(const char *level, const struct device *dev,
const char *fmt, ...); const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_emerg(const struct device *dev, const char *fmt, ...); void dev_emerg(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_alert(const struct device *dev, const char *fmt, ...); void dev_alert(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_crit(const struct device *dev, const char *fmt, ...); void dev_crit(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_err(const struct device *dev, const char *fmt, ...); void dev_err(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_warn(const struct device *dev, const char *fmt, ...); void dev_warn(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int dev_notice(const struct device *dev, const char *fmt, ...); void dev_notice(const struct device *dev, const char *fmt, ...);
extern __printf(2, 3) extern __printf(2, 3)
int _dev_info(const struct device *dev, const char *fmt, ...); void _dev_info(const struct device *dev, const char *fmt, ...);
#else #else
...@@ -1065,35 +1065,35 @@ static inline __printf(3, 4) ...@@ -1065,35 +1065,35 @@ static inline __printf(3, 4)
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
{ return 0; } { return 0; }
static inline int __dev_printk(const char *level, const struct device *dev, static inline void __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf) struct va_format *vaf)
{ return 0; } {}
static inline __printf(3, 4) static inline __printf(3, 4)
int dev_printk(const char *level, const struct device *dev, void dev_printk(const char *level, const struct device *dev,
const char *fmt, ...) const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_emerg(const struct device *dev, const char *fmt, ...) void dev_emerg(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_crit(const struct device *dev, const char *fmt, ...) void dev_crit(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_alert(const struct device *dev, const char *fmt, ...) void dev_alert(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_err(const struct device *dev, const char *fmt, ...) void dev_err(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_warn(const struct device *dev, const char *fmt, ...) void dev_warn(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int dev_notice(const struct device *dev, const char *fmt, ...) void dev_notice(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
static inline __printf(2, 3) static inline __printf(2, 3)
int _dev_info(const struct device *dev, const char *fmt, ...) void _dev_info(const struct device *dev, const char *fmt, ...)
{ return 0; } {}
#endif #endif
...@@ -1119,7 +1119,6 @@ do { \ ...@@ -1119,7 +1119,6 @@ do { \
({ \ ({ \
if (0) \ if (0) \
dev_printk(KERN_DEBUG, dev, format, ##arg); \ dev_printk(KERN_DEBUG, dev, format, ##arg); \
0; \
}) })
#endif #endif
...@@ -1215,7 +1214,6 @@ do { \ ...@@ -1215,7 +1214,6 @@ do { \
({ \ ({ \
if (0) \ if (0) \
dev_printk(KERN_DEBUG, dev, format, ##arg); \ dev_printk(KERN_DEBUG, dev, format, ##arg); \
0; \
}) })
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment