mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
regcache: rbtree: use the regmap scoped lock guard
Convert the open-coded map->lock()/map->unlock() pair in rbtree_show() to guard(regmap)(). The locked region spans the whole function body up to the single return, so a function-scope guard drops the manual unlock with no functional change. Assisted-by: LLM Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-3-8a6127223c16@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
23f1120dcb
commit
555a1bd78b
|
|
@ -141,7 +141,7 @@ static int rbtree_show(struct seq_file *s, void *ignored)
|
|||
int registers = 0;
|
||||
int this_registers, average;
|
||||
|
||||
map->lock(map->lock_arg);
|
||||
guard(regmap)(map);
|
||||
|
||||
mem_size = sizeof(*rbtree_ctx);
|
||||
|
||||
|
|
@ -168,8 +168,6 @@ static int rbtree_show(struct seq_file *s, void *ignored)
|
|||
seq_printf(s, "%d nodes, %d registers, average %d registers, used %zu bytes\n",
|
||||
nodes, registers, average, mem_size);
|
||||
|
||||
map->unlock(map->lock_arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user