diff options
author | Nicolas Iooss <nicolas.iooss_linux@m4x.org> | 2016-12-22 11:09:09 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-01-02 13:16:32 +0100 |
commit | 0aae34fa314d7dedfe756ab81787df7944de0df6 (patch) | |
tree | 6f7be04312b6e85f8f3af2b794c55273967c857c /drivers/hid/intel-ish-hid/ipc/pci-ish.c | |
parent | f39fdf2ab846ecc636d6272b47f28a05a2052a14 (diff) | |
download | op-kernel-dev-0aae34fa314d7dedfe756ab81787df7944de0df6.zip op-kernel-dev-0aae34fa314d7dedfe756ab81787df7944de0df6.tar.gz |
HID: intel-ish-hid: add printf attribute to print_log()
Structure ishtp_device contains a logging function, print_log(), which
formats some of its parameters using vsnprintf(). Add a __printf
attribute to this function field (and to ish_event_tracer()) in order to
detect at compile time issues related to the printf-like formatting.
While at it, make format parameter a const pointer as print_log() is not
supposed to modify it.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/intel-ish-hid/ipc/pci-ish.c')
-rw-r--r-- | drivers/hid/intel-ish-hid/ipc/pci-ish.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c index 20d647d..34c95de 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c @@ -47,7 +47,8 @@ MODULE_DEVICE_TABLE(pci, ish_pci_tbl); * * Callback to direct log messages to Linux trace buffers */ -static void ish_event_tracer(struct ishtp_device *dev, char *format, ...) +static __printf(2, 3) +void ish_event_tracer(struct ishtp_device *dev, const char *format, ...) { if (trace_ishtp_dump_enabled()) { va_list args; |