summaryrefslogtreecommitdiffstats
path: root/src/commonlib
diff options
context:
space:
mode:
authorPaul Menzel <pmenzel@molgen.mpg.de>2022-07-16 09:36:52 +0200
committerArthur Heymans <arthur@aheymans.xyz>2022-07-28 12:32:56 +0000
commit47eb1321c8e8519dfd6998e90b8998d004569987 (patch)
treef7b32d4f8a4b955517b9d68747e800c76ec74aae /src/commonlib
parent646802c598ba4c342ecd72cb01921954ca6d016c (diff)
downloadcoreboot-47eb1321c8e8519dfd6998e90b8998d004569987.tar.gz
coreboot-47eb1321c8e8519dfd6998e90b8998d004569987.tar.bz2
coreboot-47eb1321c8e8519dfd6998e90b8998d004569987.zip
commonlib: compiler.h: Use non-concise comment style
The concise multi-line comment style is for inside function bodies to save space. Outside of it, use non-concise style. Change-Id: I34d9ec6984b598a37c438fa3c395b5478207e31d Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65885 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/commonlib')
-rw-r--r--src/commonlib/bsd/include/commonlib/bsd/compiler.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/compiler.h b/src/commonlib/bsd/include/commonlib/bsd/compiler.h
index 2b06f87f7571..87ac0c4aeda0 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/compiler.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/compiler.h
@@ -15,19 +15,25 @@
#define __aligned(x) __attribute__((__aligned__(x)))
#endif
-/* Because there may be variables/parameters whose name contains "__unused" in
- header files of libc, namely musl, names consistent with the ones in the
- Linux kernel may be a better choice. */
+/*
+ * Because there may be variables/parameters whose name contains "__unused" in
+ * header files of libc, namely musl, names consistent with the ones in the
+ * Linux kernel may be a better choice.
+ */
-/* This is used to mark identifiers unused in all conditions, e.g. a parameter
- completely unused in all code branch, only present to fit an API. */
+/*
+ * This is used to mark identifiers unused in all conditions, e.g. a parameter
+ * completely unused in all code branch, only present to fit an API.
+ */
#ifndef __always_unused
#define __always_unused __attribute__((__unused__))
#endif
-/* This is used to mark identifiers unused in some conditions, e.g. a parameter
- only unused in some code branches, a global variable only accessed with code
- being conditionally preprocessed, etc. */
+/*
+ * This is used to mark identifiers unused in some conditions, e.g. a parameter
+ * only unused in some code branches, a global variable only accessed with code
+ * being conditionally preprocessed, etc.
+ */
#ifndef __maybe_unused
#define __maybe_unused __attribute__((__unused__))
#endif
@@ -52,13 +58,15 @@
#define __fallthrough __attribute__((__fallthrough__))
#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
- assigning macro parameters to temporary variables, because that would
- normally circumvent the special loosened type promotion rules for integer
- literals. By using this macro, the promotion can happen at the time the
- literal is assigned to the temporary variable. If the literal doesn't fit in
- the chosen type, -Werror=overflow will catch it, so this should be safe. */
+/*
+ * 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
+ * assigning macro parameters to temporary variables, because that would
+ * normally circumvent the special loosened type promotion rules for integer
+ * literals. By using this macro, the promotion can happen at the time the
+ * literal is assigned to the temporary variable. If the literal doesn't fit in
+ * the chosen type, -Werror=overflow will catch it, so this should be safe.
+ */
#define __TYPEOF_UNLESS_CONST(expr, fallback_expr) __typeof__( \
__builtin_choose_expr(__builtin_constant_p(expr), fallback_expr, expr))