Skip to content

Commit

Permalink
[review] drivers: regulator: print regulator tree summary
Browse files Browse the repository at this point in the history
Shorten variable names and rephrase inline comment.

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Nov 27, 2023
1 parent fea4ca9 commit f2bb3fd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions core/drivers/regulator/regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,14 @@ static bool regulator_is_supply_last_supplied(struct regulator *regulator)
static bool indent_with_empty_string(struct regulator *node_regulator,
int node_indent, int cur_indent)
{
struct regulator *indent_plus_one_regulator = NULL;
int indent = 0;
struct regulator *r = node_regulator;
int n = 0;

/* Find the supplied and supply of @cur_indent indentation level */
indent_plus_one_regulator = node_regulator;
for (indent = 0; indent < node_indent - cur_indent - 1; indent++)
indent_plus_one_regulator = indent_plus_one_regulator->supply;
/* Find supply at indentation level @node_indent - @cur_indent - 1 */
for (n = 0; n < node_indent - cur_indent - 1; n++)
r = r->supply;

return regulator_is_supply_last_supplied(indent_plus_one_regulator);
return regulator_is_supply_last_supplied(r);
}

static void __maybe_unused print_regulator(struct regulator *regulator,
Expand Down

0 comments on commit f2bb3fd

Please sign in to comment.