forked from Minki/linux
platform/chrome: cros_usbpd_logger: Add __printf annotation to append_str()
This allows the compiler to verify the format strings vs the types of the arguments. Also, silence the warning (triggered by W=1): cros_usbpd_logger.c:55:2: warning: function ‘append_str’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Benson Leung <bleung@chromium.org>
This commit is contained in:
parent
c032699ef9
commit
bbb7ad49b8
@ -46,6 +46,7 @@ static const char * const fault_names[] = {
|
|||||||
"---", "OCP", "fast OCP", "OVP", "Discharge"
|
"---", "OCP", "fast OCP", "OVP", "Discharge"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
__printf(3, 4)
|
||||||
static int append_str(char *buf, int pos, const char *fmt, ...)
|
static int append_str(char *buf, int pos, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
Loading…
Reference in New Issue
Block a user