Skip to content

Commit bbb7ad4

Browse files
Enric Balletbo i Serrableungatchromium
authored andcommitted
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 <[email protected]> Signed-off-by: Benson Leung <[email protected]>
1 parent c032699 commit bbb7ad4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/platform/chrome/cros_usbpd_logger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static const char * const fault_names[] = {
4646
"---", "OCP", "fast OCP", "OVP", "Discharge"
4747
};
4848

49+
__printf(3, 4)
4950
static int append_str(char *buf, int pos, const char *fmt, ...)
5051
{
5152
va_list args;

0 commit comments

Comments
 (0)