Skip to content

Commit 8a55287

Browse files
deecedcrowell77
authored andcommitted
Fix duplicated enum elements by sorting before emitting
Fix #54 (duplicated enum elements) by sorting the output of keys() before emitting the elements. Change-Id: Ib4117ca25c67de3a3d93d220695cc6e76eb4e30f ForwardPort: yes Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25015 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent fab2486 commit 8a55287

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/usr/hwpf/fapi/fapiParseErrorInfo.pl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# OpenPOWER HostBoot Project
88
#
99
# Contributors Listed Below - COPYRIGHT 2011,2016
10+
# [+] Alastair D'Silva
1011
# [+] International Business Machines Corp.
1112
#
1213
#
@@ -819,7 +820,7 @@ sub setFfdcIdValue
819820
} # gard
820821

821822
# Process the callout, deconfigures and GARDs for each Target
822-
foreach my $cdg (keys %cdgTargetHash)
823+
foreach my $cdg (sort keys %cdgTargetHash)
823824
{
824825
# Check the type
825826
print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$cdg); \\\n";
@@ -860,12 +861,12 @@ sub setFfdcIdValue
860861
}
861862

862863
# Process the callout, deconfigures and GARDs for Child Targets
863-
foreach my $parent (keys %cdgChildHash)
864+
foreach my $parent (sort keys %cdgChildHash)
864865
{
865866
# Check the type
866867
print EIFILE "fapi::fapiCheckType<const fapi::Target *>(&$parent); \\\n";
867868

868-
foreach my $childType (keys %{$cdgChildHash{$parent}})
869+
foreach my $childType (sort keys %{$cdgChildHash{$parent}})
869870
{
870871
my $callout = 0;
871872
my $priority = 'LOW';
@@ -1174,14 +1175,14 @@ sub setFfdcIdValue
11741175
print RCFILE " *\/\n";
11751176
print RCFILE "enum HwpReturnCode\n";
11761177
print RCFILE "{\n";
1177-
foreach my $key (keys %errNameToValueHash)
1178+
foreach my $key (sort keys %errNameToValueHash)
11781179
{
11791180
print RCFILE " $key = 0x$errNameToValueHash{$key},\n";
11801181
}
11811182
print RCFILE "};\n\n";
11821183
print RCFILE "}\n\n";
11831184
print RCFILE "#else\n";
1184-
foreach my $key (keys %errNameToValueHash)
1185+
foreach my $key (sort keys %errNameToValueHash)
11851186
{
11861187
print RCFILE " .set $key, 0x$errNameToValueHash{$key}\n";
11871188
}
@@ -1198,7 +1199,7 @@ sub setFfdcIdValue
11981199
print EIFILE " *\/\n";
11991200
print EIFILE "enum HwpFfdcId\n";
12001201
print EIFILE "{\n";
1201-
foreach my $key (keys %ffdcNameToValueHash)
1202+
foreach my $key (sort keys %ffdcNameToValueHash)
12021203
{
12031204
print EIFILE " $key = 0x$ffdcNameToValueHash{$key},\n";
12041205
}

0 commit comments

Comments
 (0)