of: refactor of_read_number for clarity
While the code is correct, less sophisticated static analyzers (and
users operating them..) trip over it, because they don't see that
the be32_to_cpu argument is evaluated multiple times only if it's
constant. Moving the side effect out:

- Lets us avoid the false positive
- Aligns us with what Linux does
- Makes the code IMO a bit clearer

Do so.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent d9e5eb8 commit 3e9230d661e7c9b6de8827124c97c78d3a8199ee
@Ahmad Fatoum Ahmad Fatoum authored on 29 Apr 2020
Sascha Hauer committed on 4 May 2020
Showing 1 changed file
View
include/of.h