Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Enric Balletbo i Serra and committed by
Benson Leung
bbb7ad49 c032699e

+1
+1
drivers/platform/chrome/cros_usbpd_logger.c
··· 46 46 "---", "OCP", "fast OCP", "OVP", "Discharge" 47 47 }; 48 48 49 + __printf(3, 4) 49 50 static int append_str(char *buf, int pos, const char *fmt, ...) 50 51 { 51 52 va_list args;