Skip to contentSkip to conversation

usb: typec: fusb302: Add __printf attribute to fusb302_log function

PATCH New Guenter Roeck 1 participant 1 message Mar 7, 2019 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 8/8 usb: typec: fusb302: Add __printf attribute to fusb302_log function

Quoted 4 lines · Hans de Goede

Add __printf attribute to fusb302_log function, so that we get compiler warnings when specifying wrong vararg parameters.

Quoted 26 lines
---
 drivers/usb/typec/tcpm/fusb302.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/fusb302.c +1 -1
index 6cdc38b8da74..ad1538c31dc8 100644
@@ -125,13 +125,13 @@ struct fusb302_chip {
  */
 
 #ifdef CONFIG_DEBUG_FS
-
 static bool fusb302_log_full(struct fusb302_chip *chip)
 {
 	return chip->logbuffer_tail ==
 		(chip->logbuffer_head + 1) % LOG_BUFFER_ENTRIES;
 }
 
+__printf(2, 0)
 static void _fusb302_log(struct fusb302_chip *chip, const char *fmt,
 			 va_list args)
 {
Signature · 1 line
2.20.1