diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-05-19 12:01:16 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-25 09:36:01 +0200 |
commit | 035ca2a10ef2b5776629eadb6ea97b22b7978ccb (patch) | |
tree | cf8e710f1fdbc0c87ba3c516fc6988b2888c281d /commands | |
parent | a81a28f9be1c9d40c20add6a4093d260df8c6049 (diff) | |
download | barebox-035ca2a10ef2b5776629eadb6ea97b22b7978ccb.tar.gz barebox-035ca2a10ef2b5776629eadb6ea97b22b7978ccb.tar.xz |
treewide: drop null pointer checks around of_delete_node
of_delete_node is a no-op when called on a null pointer, so remove the
useless null checks around it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230519100120.2365970-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/of_dump.c | 3 | ||||
-rw-r--r-- | commands/of_property.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/commands/of_dump.c b/commands/of_dump.c index 86755ff1e4..87a0b1ba53 100644 --- a/commands/of_dump.c +++ b/commands/of_dump.c @@ -120,8 +120,7 @@ static int do_of_dump(int argc, char *argv[]) of_print_nodes(node, 0, maxpropsize); out: - if (of_free) - of_delete_node(of_free); + of_delete_node(of_free); return ret; } diff --git a/commands/of_property.c b/commands/of_property.c index 063e97775c..b507a3541e 100644 --- a/commands/of_property.c +++ b/commands/of_property.c @@ -401,8 +401,7 @@ static int do_of_property(int argc, char *argv[]) out: - if (root) - of_delete_node(root); + of_delete_node(root); return ret; } |