commonlib: compiler.h: Add __printf macro

This patch adds the `__printf' macro to comply with checkpatch
following warning:

    Prefer __printf(1, 2) over __attribute__((format(printf, 1, 2)))

BRANCH=firmware-brya-14505.B
TEST=Successful compilation with `__printf(1, 2)' instead of
     `__attribute__((format(printf, 1, 2)))'

Change-Id: Ic2d90478ab0955c2ad0955e8cff5be76bfb2e741
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75159
Reviewed-by: Cliff Huang <cliff.huang@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Jeremy Compostella 2023-05-11 13:20:11 -07:00 committed by Felix Singer
parent 9d7e25e544
commit 33f9170dae
1 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,10 @@
#define __fallthrough __attribute__((__fallthrough__))
#endif
#ifndef __printf
#define __printf(a, b) __attribute__((format(printf, a, b)))
#endif
/*
* This evaluates to the type of the first expression, unless that is constant
* in which case it evaluates to the type of the second. This is useful when