summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>2020-04-14 22:12:39 +0200
committerBenson Leung <bleung@chromium.org>2020-05-04 23:02:01 +0200
commitbbb7ad49b8350b79261ce087c8e101d92f15533d (patch)
tree6ea154b269bba2f066cc289b43c36302f22a69b7 /drivers/platform/chrome
parentplatform/chrome: cros_ec_i2c: Appease the kernel-doc deity (diff)
downloadlinux-bbb7ad49b8350b79261ce087c8e101d92f15533d.tar.xz
linux-bbb7ad49b8350b79261ce087c8e101d92f15533d.zip
platform/chrome: cros_usbpd_logger: Add __printf annotation to append_str()
This allows the compiler to verify the format strings vs the types of the arguments. Also, silence the warning (triggered by W=1): cros_usbpd_logger.c:55:2: warning: function ‘append_str’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_usbpd_logger.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c
index 7de3ea75ef46..d16931203d82 100644
--- a/drivers/platform/chrome/cros_usbpd_logger.c
+++ b/drivers/platform/chrome/cros_usbpd_logger.c
@@ -46,6 +46,7 @@ static const char * const fault_names[] = {
"---", "OCP", "fast OCP", "OVP", "Discharge"
};
+__printf(3, 4)
static int append_str(char *buf, int pos, const char *fmt, ...)
{
va_list args;