Skip to content

Commit

Permalink
ARM: OMAP2: Delete an unnecessary check
Browse files Browse the repository at this point in the history
The of_node_put() function tests whether its argument is NULL and then
returns immediately if so.  Furthermore, the kerneldoc for
of_node_put() explicitly supports passing in a NULL pointer as its
argument.  Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[paul@pwsan.com: dropped the omap_device.c and omap_hwmod.c changes for
 now, edited the commit message accordingly and to note the documented
 "contract"]
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
  • Loading branch information
Markus Elfring authored and Paul Walmsley committed Jul 16, 2015
1 parent 9e5d46b commit 9a0cb98
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ static void __init omap_dmtimer_init(void)
/* If we are a secure device, remove any secure timer nodes */
if ((omap_type() != OMAP2_DEVICE_TYPE_GP)) {
np = omap_get_timer_dt(omap_timer_match, "ti,timer-secure");
if (np)
of_node_put(np);
of_node_put(np);
}
}

Expand Down

0 comments on commit 9a0cb98

Please sign in to comment.