From fe06ffb37fbc71fc58e83df3a299f0214cc8dd67 Mon Sep 17 00:00:00 2001 From: Hess Nathan Date: Thu, 2 May 2024 14:16:58 +0200 Subject: [PATCH] coding guidelines: comply with MISRA Rule 13.4 - avoid to use assignment expression value Signed-off-by: Hess Nathan --- lib/os/cbprintf_complete.c | 2 +- lib/utils/rb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/os/cbprintf_complete.c b/lib/os/cbprintf_complete.c index 08779d15b66..fe95fab4133 100644 --- a/lib/os/cbprintf_complete.c +++ b/lib/os/cbprintf_complete.c @@ -1060,7 +1060,7 @@ static char *encode_float(double value, /* Fraction is subnormal. Normalize it and correct * the exponent. */ - while (((fract <<= 1) & BIT_63) == 0) { + for (fract <<= 1; (fract & BIT_63) == 0; fract <<= 1) { expo--; } } diff --git a/lib/utils/rb.c b/lib/utils/rb.c index dc4bc068797..54572247bf6 100644 --- a/lib/utils/rb.c +++ b/lib/utils/rb.c @@ -537,7 +537,7 @@ static inline struct rbnode *stack_left_limb(struct rbnode *n, f->stack[f->top] = n; f->is_left[f->top] = 0U; - while ((n = get_child(n, 0U)) != NULL) { + for (n = get_child(n, 0U); n != NULL; n = get_child(n, 0U)) { f->top++; f->stack[f->top] = n; f->is_left[f->top] = 1;