From 9ca6090abaa95dd93c3c00c329ea600aaf493192 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 27 Jun 2022 14:41:55 -0600 Subject: common/util.c: Format with clang-format BUG=b:236386294 BRANCH=none TEST=none Change-Id: I92460a83a7ace84cc25d81ef3bbd53ab96921874 Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729803 Reviewed-by: Jeremy Bettis --- common/util.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'common/util.c') diff --git a/common/util.c b/common/util.c index f85eae5ebf..d2521304b9 100644 --- a/common/util.c +++ b/common/util.c @@ -23,8 +23,8 @@ __stdlib_compat int strcasecmp(const char *s1, const char *s2) static int find_base(int base, int *c, const char **nptr) { - if ((base == 0 || base == 16) && *c == '0' - && (**nptr == 'x' || **nptr == 'X')) { + if ((base == 0 || base == 16) && *c == '0' && + (**nptr == 'x' || **nptr == 'X')) { *c = (*nptr)[1]; (*nptr) += 2; base = 16; @@ -131,7 +131,6 @@ int parse_bool(const char *s, int *dest) return 0; } - /* Constant-time memory comparison */ int safe_memcmp(const void *s1, const void *s2, size_t size) { @@ -253,7 +252,7 @@ bool is_aligned(uint32_t addr, uint32_t align) int alignment_log2(unsigned int x) { - ASSERT(x != 0); /* ctz(0) is undefined */ + ASSERT(x != 0); /* ctz(0) is undefined */ return __builtin_ctz(x); } @@ -261,9 +260,9 @@ int alignment_log2(unsigned int x) /* stateful conditional stuff */ enum cond_internal_bits { - COND_CURR_MASK = BIT(0), /* current value */ - COND_RISE_MASK = BIT(1), /* set if 0->1 */ - COND_FALL_MASK = BIT(2), /* set if 1->0 */ + COND_CURR_MASK = BIT(0), /* current value */ + COND_RISE_MASK = BIT(1), /* set if 0->1 */ + COND_FALL_MASK = BIT(2), /* set if 1->0 */ }; void cond_init(cond_t *c, int val) @@ -319,8 +318,7 @@ int cond_went(cond_t *c, int val) * *offset<0. If argc