From patchwork Tue Dec 4 17:04:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Ortiz X-Patchwork-Id: 1839251 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 35C3A3FCA5 for ; Tue, 4 Dec 2012 17:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071Ab2LDRJ4 (ORCPT ); Tue, 4 Dec 2012 12:09:56 -0500 Received: from g6t0184.atlanta.hp.com ([15.193.32.61]:35468 "EHLO g6t0184.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754626Ab2LDRJx (ORCPT ); Tue, 4 Dec 2012 12:09:53 -0500 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g6t0184.atlanta.hp.com (Postfix) with ESMTP id E05A5C164; Tue, 4 Dec 2012 17:09:52 +0000 (UTC) Received: from grignak.americas.hpqcorp.net (grignak.americas.hpqcorp.net [16.71.13.117]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id ECFF4140BD; Tue, 4 Dec 2012 17:09:51 +0000 (UTC) From: Lance Ortiz Subject: [PATCH v6 3/3] aerdrv: Cleanup log output for CPER based AER 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 Date: Tue, 04 Dec 2012 10:04:42 -0700 Message-ID: <20121204170442.31397.21190.stgit@grignak.americas.hpqcorp.net> In-Reply-To: <20121204170429.31397.50068.stgit@grignak.americas.hpqcorp.net> References: <20121204170429.31397.50068.stgit@grignak.americas.hpqcorp.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- 0 files changed, 0 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;