diff options
author | Keith Busch <keith.busch@intel.com> | 2018-09-18 19:58:42 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-08 13:18:12 -0400 |
commit | fcd4d369034a819aa393f65c3a8f58db9ab5ed2a (patch) | |
tree | 706051bfd4d9cac0781c822bf2d0a8654a08341b | |
parent | 3e41a317ae456bbd7ae08d03746024ec29a7bf31 (diff) |
PCI/AER: Remove error source from AER struct aer_rpc
The AER struct aer_rpc was carrying a copy of the error source simply as a
temperary variable. Remove that from the structure and use a stack
variable for the purpose.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | drivers/pci/pcie/aer.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index a41738ff33e1..85c713f6cfdb 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c | |||
@@ -44,7 +44,6 @@ struct aer_rpc { | |||
44 | struct pci_dev *rpd; /* Root Port device */ | 44 | struct pci_dev *rpd; /* Root Port device */ |
45 | struct work_struct dpc_handler; | 45 | struct work_struct dpc_handler; |
46 | struct aer_err_source e_sources[AER_ERROR_SOURCES_MAX]; | 46 | struct aer_err_source e_sources[AER_ERROR_SOURCES_MAX]; |
47 | struct aer_err_info e_info; | ||
48 | unsigned short prod_idx; /* Error Producer Index */ | 47 | unsigned short prod_idx; /* Error Producer Index */ |
49 | unsigned short cons_idx; /* Error Consumer Index */ | 48 | unsigned short cons_idx; /* Error Consumer Index */ |
50 | int isr; | 49 | int isr; |
@@ -1176,7 +1175,7 @@ static void aer_isr_one_error(struct aer_rpc *rpc, | |||
1176 | struct aer_err_source *e_src) | 1175 | struct aer_err_source *e_src) |
1177 | { | 1176 | { |
1178 | struct pci_dev *pdev = rpc->rpd; | 1177 | struct pci_dev *pdev = rpc->rpd; |
1179 | struct aer_err_info *e_info = &rpc->e_info; | 1178 | struct aer_err_info e_info; |
1180 | 1179 | ||
1181 | pci_rootport_aer_stats_incr(pdev, e_src); | 1180 | pci_rootport_aer_stats_incr(pdev, e_src); |
1182 | 1181 | ||
@@ -1185,36 +1184,36 @@ static void aer_isr_one_error(struct aer_rpc *rpc, | |||
1185 | * uncorrectable error being logged. Report correctable error first. | 1184 | * uncorrectable error being logged. Report correctable error first. |
1186 | */ | 1185 | */ |
1187 | if (e_src->status & PCI_ERR_ROOT_COR_RCV) { | 1186 | if (e_src->status & PCI_ERR_ROOT_COR_RCV) { |
1188 | e_info->id = ERR_COR_ID(e_src->id); | 1187 | e_info.id = ERR_COR_ID(e_src->id); |
1189 | e_info->severity = AER_CORRECTABLE; | 1188 | e_info.severity = AER_CORRECTABLE; |
1190 | 1189 | ||
1191 | if (e_src->status & PCI_ERR_ROOT_MULTI_COR_RCV) | 1190 | if (e_src->status & PCI_ERR_ROOT_MULTI_COR_RCV) |
1192 | e_info->multi_error_valid = 1; | 1191 | e_info.multi_error_valid = 1; |
1193 | else | 1192 | else |
1194 | e_info->multi_error_valid = 0; | 1193 | e_info.multi_error_valid = 0; |
1195 | aer_print_port_info(pdev, e_info); | 1194 | aer_print_port_info(pdev, &e_info); |
1196 | 1195 | ||
1197 | if (find_source_device(pdev, e_info)) | 1196 | if (find_source_device(pdev, &e_info)) |
1198 | aer_process_err_devices(e_info); | 1197 | aer_process_err_devices(&e_info); |
1199 | } | 1198 | } |
1200 | 1199 | ||
1201 | if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) { | 1200 | if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) { |
1202 | e_info->id = ERR_UNCOR_ID(e_src->id); | 1201 | e_info.id = ERR_UNCOR_ID(e_src->id); |
1203 | 1202 | ||
1204 | if (e_src->status & PCI_ERR_ROOT_FATAL_RCV) | 1203 | if (e_src->status & PCI_ERR_ROOT_FATAL_RCV) |
1205 | e_info->severity = AER_FATAL; | 1204 | e_info.severity = AER_FATAL; |
1206 | else | 1205 | else |
1207 | e_info->severity = AER_NONFATAL; | 1206 | e_info.severity = AER_NONFATAL; |
1208 | 1207 | ||
1209 | if (e_src->status & PCI_ERR_ROOT_MULTI_UNCOR_RCV) | 1208 | if (e_src->status & PCI_ERR_ROOT_MULTI_UNCOR_RCV) |
1210 | e_info->multi_error_valid = 1; | 1209 | e_info.multi_error_valid = 1; |
1211 | else | 1210 | else |
1212 | e_info->multi_error_valid = 0; | 1211 | e_info.multi_error_valid = 0; |
1213 | 1212 | ||
1214 | aer_print_port_info(pdev, e_info); | 1213 | aer_print_port_info(pdev, &e_info); |
1215 | 1214 | ||
1216 | if (find_source_device(pdev, e_info)) | 1215 | if (find_source_device(pdev, &e_info)) |
1217 | aer_process_err_devices(e_info); | 1216 | aer_process_err_devices(&e_info); |
1218 | } | 1217 | } |
1219 | } | 1218 | } |
1220 | 1219 | ||