diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 339c26960e7..c1860fdef72 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2019 +# Contributors Listed Below - COPYRIGHT 2012,2020 # [+] International Business Machines Corp. # [+] YADRO # @@ -2119,7 +2119,18 @@ sub writeEnumFileAttrIdEnum { { $hexVal = $enumerator->{value}; $attrId = $enumerator->{name}; - write; + + # enforce the implicit length requirement since the format command + # does not throw an error if we overrun + my $enumsize = length($attrId); + if( $enumsize > 55 ) + { + print " $attrId = $hexVal,\n"; + } + else + { + write; + } } print $outFile "};\n\n"; @@ -2181,7 +2192,18 @@ sub writeEnumFileAttrEnums { $enumHex = sprintf "0x%08X", $enumHexValue; } $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; - write; + + # enforce the implicit length requirement since the format command + # does not throw an error if we overrun + my $enumsize = length($enumName); + if( $enumsize > 58 ) + { + print " $enumName = $enumHex,\n"; + } + else + { + write; + } } print $outFile "};\n\n"; }