Message ID | 20190307163607.24016-9-hdegoede@redhat.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | usb: typec: fusb302: Various fixes | expand |
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 >
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) {
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(-)