Browse Source

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 <yann.gautier@st.com>
Change-Id: I9989a5aaacf17f6f7a65381c8d41f21a35f6ddd9
pull/1992/head
Yann Gautier 2 years ago
parent
commit
91af163cbb
  1. 6
      drivers/st/regulator/regulator_core.c

6
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)
{

Loading…
Cancel
Save