linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lance Ortiz <lance.ortiz@hp.com>
To: bhelgaas@google.com, lance_ortiz@hotmail.com,
	jiang.liu@huawei.com, tony.luck@intel.com, bp@alien8.de,
	rostedt@goodmis.org, mchehab@redhat.com,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v6 3/3] aerdrv: Cleanup log output for CPER based AER
Date: Tue, 04 Dec 2012 10:04:42 -0700	[thread overview]
Message-ID: <20121204170442.31397.21190.stgit@grignak.americas.hpqcorp.net> (raw)
In-Reply-To: <20121204170429.31397.50068.stgit@grignak.americas.hpqcorp.net>

These changes make cper_print_aer more consistent with aer_print_error
which is called in the AER interrupt case. The string in the variable
'prefix' is printed at the beginning of each print statement in
cper_print_aer(). The prefix is a string containing the driver name
and the device's slot location.  From the callers the value of prefix
is never assigned and is NULL, so when cper_print_aer prints data the
initial string does not get printed.  This string is important because
it identifies the device that the error is on.

v1-v2 fix some compile errors withinn the #ifdef
v3-v4 remove agent id stuff and kept print the same to avoid
compatibility issues

Signed-off-by: Lance Ortiz <lance.ortiz@hp.com>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
index 34d96e4..58ff4c0 100644
--- a/drivers/pci/pcie/aer/aerdrv_errprint.c
+++ b/drivers/pci/pcie/aer/aerdrv_errprint.c
@@ -228,9 +228,14 @@ void cper_print_aer(struct pci_dev *dev, int cper_severity,
 	int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0;
 	u32 status, mask;
 	const char **status_strs;
-	char *prefix = NULL;
+	char prefix[44];
 
 	aer_severity = cper_severity_to_aer(cper_severity);
+	snprintf(prefix, sizeof(prefix), "%s%s %s: ",
+		(aer_severity == AER_CORRECTABLE) ?
+		KERN_WARNING : KERN_ERR,
+		dev_driver_string(&dev->dev), dev_name(&dev->dev));
+
 	if (aer_severity == AER_CORRECTABLE) {
 		status = aer->cor_status;
 		mask = aer->cor_mask;


  parent reply	other threads:[~2012-12-04 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 17:04 [PATCH v6 1/3] aerdrv: Trace Event for AER Lance Ortiz
2012-12-04 17:04 ` [PATCH v6 2/3] aerdrv: Enhanced AER logging Lance Ortiz
2012-12-04 18:41   ` Mauro Carvalho Chehab
2012-12-04 20:14     ` Ortiz, Lance E
2012-12-04 20:31       ` Mauro Carvalho Chehab
2012-12-04 20:36         ` Borislav Petkov
2012-12-04 17:04 ` Lance Ortiz [this message]
2012-12-04 17:39   ` [PATCH v6 3/3] aerdrv: Cleanup log output for CPER based AER Joe Perches
2012-12-04 20:06     ` Ortiz, Lance E
2012-12-04 18:36 ` [PATCH v6 1/3] aerdrv: Trace Event for AER Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121204170442.31397.21190.stgit@grignak.americas.hpqcorp.net \
    --to=lance.ortiz@hp.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=jiang.liu@huawei.com \
    --cc=lance_ortiz@hotmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).