Skip to content

Commit 79005fb

Browse files
Felipe BalbiPaul Walmsley
authored andcommitted
ARM: OMAP2+: hwmod: drop unnecessary list initialization
ml->node and sl->node are currently initialized by means of INIT_LIST_HEAD(). That initialiation is followed by a list_add() call. Looking at what both these functions do we will have: ml->node.next = &ml->node; ml->node.prev = &ml->node; oi->master->master_ports.next.prev = &ml->node; ml->node.next = &oi->master->master_ports.next; ml->node.prev = &oi->master->master_ports; oi->master->master_ports.next = &ml->node; from this, it's clear that both INIT_LIST_HEAD() calls are unnecessary and can be safely removed. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
1 parent 2e1a7b0 commit 79005fb

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,12 +2832,10 @@ static int __init _add_link(struct omap_hwmod_ocp_if *oi)
28322832
_alloc_links(&ml, &sl);
28332833

28342834
ml->ocp_if = oi;
2835-
INIT_LIST_HEAD(&ml->node);
28362835
list_add(&ml->node, &oi->master->master_ports);
28372836
oi->master->masters_cnt++;
28382837

28392838
sl->ocp_if = oi;
2840-
INIT_LIST_HEAD(&sl->node);
28412839
list_add(&sl->node, &oi->slave->slave_ports);
28422840
oi->slave->slaves_cnt++;
28432841

0 commit comments

Comments
 (0)