From 91af163cbbfab936e70568998e8b9dcb10203b8e Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Fri, 25 Nov 2022 16:25:46 +0100 Subject: [PATCH] fix(st-regulator): enclose macro parameters in parentheses This corrects MISRA C2012-20.7: Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses. Signed-off-by: Yann Gautier Change-Id: I9989a5aaacf17f6f7a65381c8d41f21a35f6ddd9 --- drivers/st/regulator/regulator_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/st/regulator/regulator_core.c b/drivers/st/regulator/regulator_core.c index d65d501b2..f15e22ac0 100644 --- a/drivers/st/regulator/regulator_core.c +++ b/drivers/st/regulator/regulator_core.c @@ -22,11 +22,11 @@ CASSERT(PLAT_NB_RDEVS >= 1U, plat_nb_rdevs_must_be_higher); static struct rdev rdev_array[PLAT_NB_RDEVS]; #define for_each_rdev(rdev) \ - for (rdev = rdev_array; rdev <= &rdev_array[PLAT_NB_RDEVS - 1U]; rdev++) + for ((rdev) = rdev_array; (rdev) <= &rdev_array[PLAT_NB_RDEVS - 1U]; (rdev)++) #define for_each_registered_rdev(rdev) \ - for (rdev = rdev_array; \ - (rdev <= &rdev_array[PLAT_NB_RDEVS - 1U]) && (rdev->desc != NULL); rdev++) + for ((rdev) = rdev_array; \ + ((rdev) <= &rdev_array[PLAT_NB_RDEVS - 1U]) && ((rdev)->desc != NULL); (rdev)++) static void lock_driver(const struct rdev *rdev) {