Skip to content

Commit 9a884bd

Browse files
sfrothwellPeter Zijlstra
authored andcommitted
iio: magnetometer: fix if () scoped_guard() formatting
Add mising braces after an if condition that contains scoped_guard(). This style is both preferred and necessary here, to fix warning after scoped_guard() change in commit fcc22ac ("cleanup: Adjust scoped_guard() macros to avoid potential warning") to have if-else inside of the macro. Current (no braces) use in af8133j_set_scale() yields the following warnings: af8133j.c:315:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else] af8133j.c:316:3: warning: add explicit braces to avoid dangling else [-Wdangling-else] Fixes: fcc22ac ("cleanup: Adjust scoped_guard() macros to avoid potential warning") Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Reported-by: kernel test robot <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5c2e773 commit 9a884bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iio/magnetometer/af8133j.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,11 @@ static int af8133j_set_scale(struct af8133j_data *data,
312312
* When suspended, just store the new range to data->range to be
313313
* applied later during power up.
314314
*/
315-
if (!pm_runtime_status_suspended(dev))
315+
if (!pm_runtime_status_suspended(dev)) {
316316
scoped_guard(mutex, &data->mutex)
317317
ret = regmap_write(data->regmap,
318318
AF8133J_REG_RANGE, range);
319+
}
319320

320321
pm_runtime_enable(dev);
321322

0 commit comments

Comments
 (0)