Re: [PATCH 22/30] usb: typec: tcpm: fusb302: Use 'gnu_printf' format notation

From: Guenter Roeck
Date: Fri Jul 03 2020 - 15:01:55 EST


On 7/3/20 10:41 AM, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/usb/typec/tcpm/fusb302.c: In function âfusb302_logâ:
> drivers/usb/typec/tcpm/fusb302.c:186:2: warning: function âfusb302_logâ might be a candidate for âgnu_printfâ format attribute [-Wsuggest-attribute=format]
> 186 | _fusb302_log(chip, fmt, args);
> | ^~~~~~~~~~~~
>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> Cc: Yueyao Zhu <yueyao.zhu@xxxxxxxxx>
> Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
> drivers/usb/typec/tcpm/fusb302.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index b28facece43c4..99562cc65ca69 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -178,6 +178,7 @@ static void _fusb302_log(struct fusb302_chip *chip, const char *fmt,
> mutex_unlock(&chip->logbuffer_lock);
> }
>
> +__printf(2, 3)
> static void fusb302_log(struct fusb302_chip *chip, const char *fmt, ...)
> {
> va_list args;
>