* [v2,8/8] usb: typec: fusb302: Add __printf attribute to fusb302_log function
@ 2019-03-07 16:36 Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2019-03-07 16:36 UTC (permalink / raw)
To: Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, linux-usb
Add __printf attribute to fusb302_log function, so that we get
compiler warnings when specifying wrong vararg parameters.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/usb/typec/tcpm/fusb302.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
index 6cdc38b8da74..ad1538c31dc8 100644
--- a/drivers/usb/typec/tcpm/fusb302.c
+++ b/drivers/usb/typec/tcpm/fusb302.c
@@ -125,13 +125,13 @@ struct fusb302_chip {
*/
#ifdef CONFIG_DEBUG_FS
-
static bool fusb302_log_full(struct fusb302_chip *chip)
{
return chip->logbuffer_tail ==
(chip->logbuffer_head + 1) % LOG_BUFFER_ENTRIES;
}
+__printf(2, 0)
static void _fusb302_log(struct fusb302_chip *chip, const char *fmt,
va_list args)
{
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [v2,8/8] usb: typec: fusb302: Add __printf attribute to fusb302_log function
@ 2019-03-07 18:26 Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-03-07 18:26 UTC (permalink / raw)
To: Hans de Goede; +Cc: Greg Kroah-Hartman, Heikki Krogerus, linux-usb
On Thu, Mar 07, 2019 at 05:36:07PM +0100, Hans de Goede wrote:
> Add __printf attribute to fusb302_log function, so that we get
> compiler warnings when specifying wrong vararg parameters.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/usb/typec/tcpm/fusb302.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index 6cdc38b8da74..ad1538c31dc8 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -125,13 +125,13 @@ struct fusb302_chip {
> */
>
> #ifdef CONFIG_DEBUG_FS
> -
> static bool fusb302_log_full(struct fusb302_chip *chip)
> {
> return chip->logbuffer_tail ==
> (chip->logbuffer_head + 1) % LOG_BUFFER_ENTRIES;
> }
>
> +__printf(2, 0)
> static void _fusb302_log(struct fusb302_chip *chip, const char *fmt,
> va_list args)
> {
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-07 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 16:36 [v2,8/8] usb: typec: fusb302: Add __printf attribute to fusb302_log function Hans de Goede
2019-03-07 18:26 Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.