Skip to content

Commit

Permalink
device.h: Add missing inline to #ifndef CONFIG_PRINTK dev_vprintk_emit
Browse files Browse the repository at this point in the history
Also add __printf() verification for format string.

Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
JoePerches authored and gregkh committed Sep 26, 2012
1 parent e5445ee commit 0a18b05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,9 @@ extern const char *dev_driver_string(const struct device *dev);

#ifdef CONFIG_PRINTK

extern int dev_vprintk_emit(int level, const struct device *dev,
const char *fmt, va_list args);
extern __printf(3, 0)
int dev_vprintk_emit(int level, const struct device *dev,
const char *fmt, va_list args);
extern __printf(3, 4)
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);

Expand All @@ -920,8 +921,9 @@ int _dev_info(const struct device *dev, const char *fmt, ...);

#else

static int dev_vprintk_emit(int level, const struct device *dev,
const char *fmt, va_list args)
static inline __printf(3, 0)
int dev_vprintk_emit(int level, const struct device *dev,
const char *fmt, va_list args)
{ return 0; }
static inline __printf(3, 4)
int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...)
Expand Down

0 comments on commit 0a18b05

Please sign in to comment.