浏览代码

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 <nicolas.iooss_linux@m4x.org>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Nicolas Iooss 9 年之前
父节点
当前提交
e135ab7405
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/usb/dwc2/hcd_queue.c

+ 2 - 1
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;