From: Nicolas Iooss Date: Sun, 26 Jun 2016 08:12:38 +0000 (+0200) Subject: usb: dwc2: add printf attribute to cat_printf() X-Git-Tag: v4.8-rc1~191^2~23^2~4 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e135ab7405f562c7709806e355b1521ee68548dc;p=linux.git usb: dwc2: add printf attribute to cat_printf() As cat_printf() uses printf format strings in its parameters, adding __printf attribute allows the compiler to detect at compile-time some errors related to format strings (with -Wformat warning flag). Signed-off-by: Nicolas Iooss Acked-by: John Youn Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index b5c7793a2df2..13754353251f 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -367,7 +367,8 @@ static void pmap_unschedule(unsigned long *map, int bits_per_period, * @fmt: The format for printf. * @...: The args for printf. */ -static void cat_printf(char **buf, size_t *size, const char *fmt, ...) +static __printf(3, 4) +void cat_printf(char **buf, size_t *size, const char *fmt, ...) { va_list args; int i;