Skip to content

Commit

Permalink
HID: make function from dbg_hid
Browse files Browse the repository at this point in the history
To check paramters even if debug is disabled, convert dbg_hid
to inline function with __attribute__(format) checking.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Slaby authored and Jiri Kosina committed Apr 22, 2008
1 parent 282bfd4 commit 1b184cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ static inline int hid_ff_init(struct hid_device *hid) { return -1; }
#define dbg_hid_line(format, arg...) if (hid_debug) \
printk(format, ## arg)
#else
#define dbg_hid(format, arg...) do {} while (0)
static inline int __attribute__((format(printf, 1, 2)))
dbg_hid(const char *fmt, ...)
{
return 0;
}
#define dbg_hid_line dbg_hid
#endif

Expand Down

0 comments on commit 1b184cf

Please sign in to comment.