summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-28 17:34:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-29 08:41:53 +0200
commit9699096f1eccd742d898f471b046181ea90dd582 (patch)
tree1b62f4c159a6ae9b90eac7d750a4833b0e30a7dc /common
parent12d74001d52911dfb96d81b774183aeaba21370c (diff)
downloadbarebox-9699096f1eccd742d898f471b046181ea90dd582.tar.gz
barebox-9699096f1eccd742d898f471b046181ea90dd582.tar.xz
treewide: replace strerror(-PTR_ERR(errno)) with %pe format specifier
Using %pe instead of PTR_ERR has the benefit of being less verbose and less error-prone (no negation necessary) while potentially reducing code size. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/state/state.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/state/state.c b/common/state/state.c
index d42920985d..9d04eab312 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -271,9 +271,8 @@ static int state_convert_node_variable(struct state *state,
if (conv == STATE_CONVERT_FROM_NODE_CREATE) {
sv = vtype->create(state, name, node, vtype);
if (IS_ERR(sv)) {
+ dev_err(&state->dev, "failed to create %s: %pe\n", name, sv);
ret = PTR_ERR(sv);
- dev_err(&state->dev, "failed to create %s: %s\n", name,
- strerror(-ret));
goto out_free;
}