Skip to content

Commit 09683a6

Browse files
drobnikbjorn-helgaas
authored andcommitted
PCI/AER: Rename struct aer_stats to aer_info
Update name to reflect the broader definition of structs/variables that are stored (e.g. ratelimits). This is a preparatory patch for adding rate limit support. [bhelgaas: "aer_report" -> "aer_info"] Signed-off-by: Karolina Stolarek <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 36c5932 commit 09683a6

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

drivers/pci/pcie/aer.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ struct aer_rpc {
5454
DECLARE_KFIFO(aer_fifo, struct aer_err_source, AER_ERROR_SOURCES_MAX);
5555
};
5656

57-
/* AER stats for the device */
58-
struct aer_stats {
57+
/* AER info for the device */
58+
struct aer_info {
5959

6060
/*
6161
* Fields for all AER capable devices. They indicate the errors
@@ -377,7 +377,7 @@ void pci_aer_init(struct pci_dev *dev)
377377
if (!dev->aer_cap)
378378
return;
379379

380-
dev->aer_stats = kzalloc(sizeof(struct aer_stats), GFP_KERNEL);
380+
dev->aer_info = kzalloc(sizeof(*dev->aer_info), GFP_KERNEL);
381381

382382
/*
383383
* We save/restore PCI_ERR_UNCOR_MASK, PCI_ERR_UNCOR_SEVER,
@@ -398,8 +398,8 @@ void pci_aer_init(struct pci_dev *dev)
398398

399399
void pci_aer_exit(struct pci_dev *dev)
400400
{
401-
kfree(dev->aer_stats);
402-
dev->aer_stats = NULL;
401+
kfree(dev->aer_info);
402+
dev->aer_info = NULL;
403403
}
404404

405405
#define AER_AGENT_RECEIVER 0
@@ -537,10 +537,10 @@ static const char *aer_agent_string[] = {
537537
{ \
538538
unsigned int i; \
539539
struct pci_dev *pdev = to_pci_dev(dev); \
540-
u64 *stats = pdev->aer_stats->stats_array; \
540+
u64 *stats = pdev->aer_info->stats_array; \
541541
size_t len = 0; \
542542
\
543-
for (i = 0; i < ARRAY_SIZE(pdev->aer_stats->stats_array); i++) {\
543+
for (i = 0; i < ARRAY_SIZE(pdev->aer_info->stats_array); i++) { \
544544
if (strings_array[i]) \
545545
len += sysfs_emit_at(buf, len, "%s %llu\n", \
546546
strings_array[i], \
@@ -551,7 +551,7 @@ static const char *aer_agent_string[] = {
551551
i, stats[i]); \
552552
} \
553553
len += sysfs_emit_at(buf, len, "TOTAL_%s %llu\n", total_string, \
554-
pdev->aer_stats->total_field); \
554+
pdev->aer_info->total_field); \
555555
return len; \
556556
} \
557557
static DEVICE_ATTR_RO(name)
@@ -572,7 +572,7 @@ aer_stats_dev_attr(aer_dev_nonfatal, dev_nonfatal_errs,
572572
char *buf) \
573573
{ \
574574
struct pci_dev *pdev = to_pci_dev(dev); \
575-
return sysfs_emit(buf, "%llu\n", pdev->aer_stats->field); \
575+
return sysfs_emit(buf, "%llu\n", pdev->aer_info->field); \
576576
} \
577577
static DEVICE_ATTR_RO(name)
578578

@@ -599,7 +599,7 @@ static umode_t aer_stats_attrs_are_visible(struct kobject *kobj,
599599
struct device *dev = kobj_to_dev(kobj);
600600
struct pci_dev *pdev = to_pci_dev(dev);
601601

602-
if (!pdev->aer_stats)
602+
if (!pdev->aer_info)
603603
return 0;
604604

605605
if ((a == &dev_attr_aer_rootport_total_err_cor.attr ||
@@ -623,25 +623,25 @@ static void pci_dev_aer_stats_incr(struct pci_dev *pdev,
623623
unsigned long status = info->status & ~info->mask;
624624
int i, max = -1;
625625
u64 *counter = NULL;
626-
struct aer_stats *aer_stats = pdev->aer_stats;
626+
struct aer_info *aer_info = pdev->aer_info;
627627

628-
if (!aer_stats)
628+
if (!aer_info)
629629
return;
630630

631631
switch (info->severity) {
632632
case AER_CORRECTABLE:
633-
aer_stats->dev_total_cor_errs++;
634-
counter = &aer_stats->dev_cor_errs[0];
633+
aer_info->dev_total_cor_errs++;
634+
counter = &aer_info->dev_cor_errs[0];
635635
max = AER_MAX_TYPEOF_COR_ERRS;
636636
break;
637637
case AER_NONFATAL:
638-
aer_stats->dev_total_nonfatal_errs++;
639-
counter = &aer_stats->dev_nonfatal_errs[0];
638+
aer_info->dev_total_nonfatal_errs++;
639+
counter = &aer_info->dev_nonfatal_errs[0];
640640
max = AER_MAX_TYPEOF_UNCOR_ERRS;
641641
break;
642642
case AER_FATAL:
643-
aer_stats->dev_total_fatal_errs++;
644-
counter = &aer_stats->dev_fatal_errs[0];
643+
aer_info->dev_total_fatal_errs++;
644+
counter = &aer_info->dev_fatal_errs[0];
645645
max = AER_MAX_TYPEOF_UNCOR_ERRS;
646646
break;
647647
}
@@ -653,19 +653,19 @@ static void pci_dev_aer_stats_incr(struct pci_dev *pdev,
653653
static void pci_rootport_aer_stats_incr(struct pci_dev *pdev,
654654
struct aer_err_source *e_src)
655655
{
656-
struct aer_stats *aer_stats = pdev->aer_stats;
656+
struct aer_info *aer_info = pdev->aer_info;
657657

658-
if (!aer_stats)
658+
if (!aer_info)
659659
return;
660660

661661
if (e_src->status & PCI_ERR_ROOT_COR_RCV)
662-
aer_stats->rootport_total_cor_errs++;
662+
aer_info->rootport_total_cor_errs++;
663663

664664
if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) {
665665
if (e_src->status & PCI_ERR_ROOT_FATAL_RCV)
666-
aer_stats->rootport_total_fatal_errs++;
666+
aer_info->rootport_total_fatal_errs++;
667667
else
668-
aer_stats->rootport_total_nonfatal_errs++;
668+
aer_info->rootport_total_nonfatal_errs++;
669669
}
670670
}
671671

include/linux/pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ struct pci_dev {
346346
u8 hdr_type; /* PCI header type (`multi' flag masked out) */
347347
#ifdef CONFIG_PCIEAER
348348
u16 aer_cap; /* AER capability offset */
349-
struct aer_stats *aer_stats; /* AER stats for this device */
349+
struct aer_info *aer_info; /* AER info for this device */
350350
#endif
351351
#ifdef CONFIG_PCIEPORTBUS
352352
struct rcec_ea *rcec_ea; /* RCEC cached endpoint association */

0 commit comments

Comments
 (0)