Skip to contentSkip to conversation

driver core: add __printf verification to __ata_ehi_pushv_desc

PATCH Applied Mathieu Malaterre 2 participants 2 messages May 5, 2018 – May 7, 2018 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: add __printf verification to __ata_ehi_pushv_desc

__printf is useful to verify format and arguments. Remove the following warning (with W=1):

drivers/ata/libata-eh.c:183:10: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

---
 drivers/ata/libata-eh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/libata-eh.c +2 -2
index c016829a38fd..513b260bcff1 100644
@@ -175,8 +175,8 @@ static void ata_eh_handle_port_resume(struct ata_port *ap)
 { }
 #endif /* CONFIG_PM */
 
-static void __ata_ehi_pushv_desc(struct ata_eh_info *ehi, const char *fmt,
-				 va_list args)
+static __printf(2, 0) void __ata_ehi_pushv_desc(struct ata_eh_info *ehi,
+				 const char *fmt, va_list args)
 {
 	ehi->desc_len += vscnprintf(ehi->desc + ehi->desc_len,
 				     ATA_EH_DESC_LEN - ehi->desc_len,
Signature · 1 line
2.11.0
Applied
#1 lore raw
Quoted 6 lines · Mathieu Malaterre

__printf is useful to verify format and arguments. Remove the following warning (with W=1):

drivers/ata/libata-eh.c:183:10: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Applied to libata/for-4.17-fixes.

Thanks.

Signature · 1 line
tejun