* [PATCH 1/1] usb: dwc2: add printf attribute to cat_printf()
@ 2016-06-26 8:12 Nicolas Iooss
2016-06-28 1:59 ` John Youn
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2016-06-26 8:12 UTC (permalink / raw)
To: John Youn, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Nicolas Iooss
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>
---
drivers/usb/dwc2/hcd_queue.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.9.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] usb: dwc2: add printf attribute to cat_printf()
2016-06-26 8:12 [PATCH 1/1] usb: dwc2: add printf attribute to cat_printf() Nicolas Iooss
@ 2016-06-28 1:59 ` John Youn
0 siblings, 0 replies; 2+ messages in thread
From: John Youn @ 2016-06-28 1:59 UTC (permalink / raw)
To: Nicolas Iooss, John Youn, Greg Kroah-Hartman, Felipe Balbi
Cc: linux-usb, linux-kernel
On 6/26/2016 1:12 AM, Nicolas Iooss wrote:
> 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>
> ---
> drivers/usb/dwc2/hcd_queue.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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;
>
Acked-by: John Youn <johnyoun@synopsys.com>
John
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-28 1:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-26 8:12 [PATCH 1/1] usb: dwc2: add printf attribute to cat_printf() Nicolas Iooss
2016-06-28 1:59 ` John Youn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®