@@ -447,7 +447,7 @@ static const char *aer_error_layer[] = {
447
447
"Transaction Layer"
448
448
};
449
449
450
- static const char * aer_correctable_error_string [AER_MAX_TYPEOF_COR_ERRS ] = {
450
+ static const char * aer_correctable_error_string [] = {
451
451
"RxErr" , /* Bit Position 0 */
452
452
NULL ,
453
453
NULL ,
@@ -464,9 +464,25 @@ static const char *aer_correctable_error_string[AER_MAX_TYPEOF_COR_ERRS] = {
464
464
"NonFatalErr" , /* Bit Position 13 */
465
465
"CorrIntErr" , /* Bit Position 14 */
466
466
"HeaderOF" , /* Bit Position 15 */
467
+ NULL , /* Bit Position 16 */
468
+ NULL , /* Bit Position 17 */
469
+ NULL , /* Bit Position 18 */
470
+ NULL , /* Bit Position 19 */
471
+ NULL , /* Bit Position 20 */
472
+ NULL , /* Bit Position 21 */
473
+ NULL , /* Bit Position 22 */
474
+ NULL , /* Bit Position 23 */
475
+ NULL , /* Bit Position 24 */
476
+ NULL , /* Bit Position 25 */
477
+ NULL , /* Bit Position 26 */
478
+ NULL , /* Bit Position 27 */
479
+ NULL , /* Bit Position 28 */
480
+ NULL , /* Bit Position 29 */
481
+ NULL , /* Bit Position 30 */
482
+ NULL , /* Bit Position 31 */
467
483
};
468
484
469
- static const char * aer_uncorrectable_error_string [AER_MAX_TYPEOF_UNCOR_ERRS ] = {
485
+ static const char * aer_uncorrectable_error_string [] = {
470
486
"Undefined" , /* Bit Position 0 */
471
487
NULL ,
472
488
NULL ,
@@ -494,6 +510,11 @@ static const char *aer_uncorrectable_error_string[AER_MAX_TYPEOF_UNCOR_ERRS] = {
494
510
"AtomicOpBlocked" , /* Bit Position 24 */
495
511
"TLPBlockedErr" , /* Bit Position 25 */
496
512
"PoisonTLPBlocked" , /* Bit Position 26 */
513
+ NULL , /* Bit Position 27 */
514
+ NULL , /* Bit Position 28 */
515
+ NULL , /* Bit Position 29 */
516
+ NULL , /* Bit Position 30 */
517
+ NULL , /* Bit Position 31 */
497
518
};
498
519
499
520
static const char * aer_agent_string [] = {
@@ -650,24 +671,23 @@ static void __print_tlp_header(struct pci_dev *dev,
650
671
static void __aer_print_error (struct pci_dev * dev ,
651
672
struct aer_err_info * info )
652
673
{
674
+ const char * * strings ;
653
675
unsigned long status = info -> status & ~info -> mask ;
654
- const char * errmsg = NULL ;
676
+ const char * errmsg ;
655
677
int i ;
656
678
679
+ if (info -> severity == AER_CORRECTABLE )
680
+ strings = aer_correctable_error_string ;
681
+ else
682
+ strings = aer_uncorrectable_error_string ;
683
+
657
684
for_each_set_bit (i , & status , 32 ) {
658
- if (info -> severity == AER_CORRECTABLE )
659
- errmsg = i < ARRAY_SIZE (aer_correctable_error_string ) ?
660
- aer_correctable_error_string [i ] : NULL ;
661
- else
662
- errmsg = i < ARRAY_SIZE (aer_uncorrectable_error_string ) ?
663
- aer_uncorrectable_error_string [i ] : NULL ;
685
+ errmsg = strings [i ];
686
+ if (!errmsg )
687
+ errmsg = "Unknown Error Bit" ;
664
688
665
- if (errmsg )
666
- pci_err (dev , " [%2d] %-22s%s\n" , i , errmsg ,
689
+ pci_err (dev , " [%2d] %-22s%s\n" , i , errmsg ,
667
690
info -> first_error == i ? " (First)" : "" );
668
- else
669
- pci_err (dev , " [%2d] Unknown Error Bit%s\n" ,
670
- i , info -> first_error == i ? " (First)" : "" );
671
691
}
672
692
pci_dev_aer_stats_incr (dev , info );
673
693
}
0 commit comments