UPSTREAM: usb: dwc2: add printf attribute to cat_printf()
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Sun, 26 Jun 2016 08:12:38 +0000 (10:12 +0200)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 10:48:50 +0000 (18:48 +0800)
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).

Change-Id: I3558d4a331acdf057c1daccbe86008ae0fd07216
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit e135ab7405f562c7709806e355b1521ee68548dc)

drivers/usb/dwc2/hcd_queue.c

index b5c7793a2df2b1cdd7623f278d7faa161812de01..13754353251f1a2252a1cf743d6c19523859c478 100644 (file)
@@ -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;