diff options
author | Jeremy Compostella <jeremy.compostella@intel.com> | 2023-05-11 13:20:11 -0700 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2023-05-15 16:35:27 +0000 |
commit | 33f9170dae59116f74a8189f2516cc12c8f90c15 (patch) | |
tree | 8ee731ec129244d63befbe6e2c8cc71a25dd0fa6 | |
parent | 9d7e25e544689913d7fefc36c99783190095cfbf (diff) |
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>
-rw-r--r-- | src/commonlib/bsd/include/commonlib/bsd/compiler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/compiler.h b/src/commonlib/bsd/include/commonlib/bsd/compiler.h index 87ac0c4aed..6bde28db0e 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/compiler.h +++ b/src/commonlib/bsd/include/commonlib/bsd/compiler.h @@ -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 |