Skip to content

Commit 99d4402

Browse files
Chen, Gongbjorn-helgaas
authored andcommitted
trace, RAS: Replace bare numbers with #defines for PCIe AER error strings
Replace bare numbers like "BIT(0)" with the existing #defines, e.g., PCI_ERR_COR_RCVR, to improve maintainability. This way grep will find more uses of the #defines. No functional change. [bhelgaas: changelog] Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 52addcf commit 99d4402

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

‎include/ras/ras_event.h‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/tracepoint.h>
99
#include <linux/edac.h>
1010
#include <linux/ktime.h>
11+
#include <linux/pci.h>
1112
#include <linux/aer.h>
1213
#include <linux/cper.h>
1314

@@ -174,24 +175,24 @@ TRACE_EVENT(mc_event,
174175
*/
175176

176177
#define aer_correctable_errors \
177-
{BIT(0), "Receiver Error"}, \
178-
{BIT(6), "Bad TLP"}, \
179-
{BIT(7), "Bad DLLP"}, \
180-
{BIT(8), "RELAY_NUM Rollover"}, \
181-
{BIT(12), "Replay Timer Timeout"}, \
182-
{BIT(13), "Advisory Non-Fatal"}
178+
{PCI_ERR_COR_RCVR, "Receiver Error"}, \
179+
{PCI_ERR_COR_BAD_TLP, "Bad TLP"}, \
180+
{PCI_ERR_COR_BAD_DLLP, "Bad DLLP"}, \
181+
{PCI_ERR_COR_REP_ROLL, "RELAY_NUM Rollover"}, \
182+
{PCI_ERR_COR_REP_TIMER, "Replay Timer Timeout"},\
183+
{PCI_ERR_COR_ADV_NFAT, "Advisory Non-Fatal"}
183184

184185
#define aer_uncorrectable_errors \
185-
{BIT(4), "Data Link Protocol"}, \
186-
{BIT(12), "Poisoned TLP"}, \
187-
{BIT(13), "Flow Control Protocol"}, \
188-
{BIT(14), "Completion Timeout"}, \
189-
{BIT(15), "Completer Abort"}, \
190-
{BIT(16), "Unexpected Completion"}, \
191-
{BIT(17), "Receiver Overflow"}, \
192-
{BIT(18), "Malformed TLP"}, \
193-
{BIT(19), "ECRC"}, \
194-
{BIT(20), "Unsupported Request"}
186+
{PCI_ERR_UNC_DLP, "Data Link Protocol"}, \
187+
{PCI_ERR_UNC_POISON_TLP,"Poisoned TLP"}, \
188+
{PCI_ERR_UNC_FCP, "Flow Control Protocol"}, \
189+
{PCI_ERR_UNC_COMP_TIME, "Completion Timeout"}, \
190+
{PCI_ERR_UNC_COMP_ABORT,"Completer Abort"}, \
191+
{PCI_ERR_UNC_UNX_COMP, "Unexpected Completion"}, \
192+
{PCI_ERR_UNC_RX_OVER, "Receiver Overflow"}, \
193+
{PCI_ERR_UNC_MALF_TLP, "Malformed TLP"}, \
194+
{PCI_ERR_UNC_ECRC, "ECRC"}, \
195+
{PCI_ERR_UNC_UNSUP, "Unsupported Request"}
195196

196197
TRACE_EVENT(aer_event,
197198
TP_PROTO(const char *dev_name,

0 commit comments

Comments
 (0)