mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Lance Ortiz <lance.ortiz@hp.com>
Cc: 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: Re: [PATCH v8 3/3] aerdrv: Cleanup log output for AER
Date: Wed, 02 Jan 2013 15:27:39 -0800	[thread overview]
Message-ID: <1357169259.25181.9.camel@joe-AO722> (raw)
In-Reply-To: <20130102232743.5706.63153.stgit@grignak.americas.hpqcorp.net>

On Wed, 2013-01-02 at 16:27 -0700, Lance Ortiz wrote:
> These changes make cper_print_aer more consistent with aer_print_error
> and clean things up by elimiating the use of the prefix variable and
> replacing it with dev_printk.
[]
> v7-v8 Updated to use dev_printk instated of prefix. Changed
> log levels to KERN_ERR as per Mauro's suggestion

Just use dev_err( instead of dev_printk(KERN_ERR,
It's a function and it makes the object code smaller.

> diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
[]
> @@ -144,26 +143,24 @@ static void __aer_print_error(const char *prefix,
>  				aer_uncorrectable_error_string[i] : NULL;
>  
>  		if (errmsg)
> -			printk("%s""   [%2d] %-22s%s\n", prefix, i, errmsg,
> +			dev_printk(KERN_ERR, &dev->dev,
> +				"   [%2d] %-22s%s\n", i, errmsg,
>  				info->first_error == i ? " (First)" : "");
>  		else
> -			printk("%s""   [%2d] Unknown Error Bit%s\n", prefix, i,
> -				info->first_error == i ? " (First)" : "");
> +			dev_printk(KERN_ERR, &dev->dev,
> +				"   [%2d] Unknown Error Bit%s\n",
> +				i, info->first_error == i ? " (First)" : "");
>  	}
[]
>  	if (info->status == 0) {
> -		printk("%s""PCIe Bus Error: severity=%s, type=Unaccessible, "
> -			"id=%04x(Unregistered Agent ID)\n", prefix,
> +		dev_printk(KERN_ERR, &dev->dev,
> +			"PCIe Bus Error: severity=%s, type=Unaccessible, "
> +			"id=%04x(Unregistered Agent ID)\n",
[]
> @@ -171,22 +168,24 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
[]
> +		dev_printk(KERN_ERR, &dev->dev,
> +			"PCIe Bus Error: severity=%s, type=%s, id=%04x(%s)\n",
> +			aer_error_severity_string[info->severity],
[]
> +		dev_printk(KERN_ERR, &dev->dev,
> +			"  device [%04x:%04x] error status/mask=%08x/%08x\n",
> +			dev->vendor, dev->device,
>  			info->status, info->mask);
[]
> +			dev_printk(KERN_ERR, &dev->dev, "  TLP Header:"
>  				" %02x%02x%02x%02x %02x%02x%02x%02x"
>  				" %02x%02x%02x%02x %02x%02x%02x%02x\n",
[]
> @@ -195,8 +194,9 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
[]
> +		dev_printk(KERN_ERR, &dev->dev,
> +			   "  Error of this Agent(%04x) is reported first\n",
> +			id);
[]
> @@ -244,21 +244,21 @@ void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity,
[]
> +	dev_printk(KERN_ERR, &dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n",
> +	       status, mask);
[]
> +	dev_printk(KERN_ERR, &dev->dev, "aer_layer=%s, aer_agent=%s\n",
>  	       aer_error_layer[layer], aer_agent_string[agent]);
[]
> +		dev_printk(KERN_ERR, &dev->dev, "aer_tlp_header:"



  reply	other threads:[~2013-01-02 23:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02 23:27 [PATCH v8 1/3] aerdrv: Trace Event " Lance Ortiz
2013-01-02 23:27 ` [PATCH v8 2/3] aerdrv: Enhanced AER logging Lance Ortiz
2013-01-02 23:27 ` [PATCH v8 3/3] aerdrv: Cleanup log output for AER Lance Ortiz
2013-01-02 23:27   ` Joe Perches [this message]
2013-01-02 23:41     ` Tony Luck
2013-01-03 15:51       ` Borislav Petkov
2013-01-03  0:06   ` [PATCH] checkpatch: prefer dev_<level>( to dev_printk(KERN_<LEVEL> Joe Perches
     [not found]     ` <20130102160935.ec405bc4.akpm@linux-foundation.org>
2013-01-03  0:33       ` [PATCH] checkpatch: Warn on unnecessary __dev<foo> section markings Joe Perches
2013-01-03 10:09         ` Andy Whitcroft
2013-01-03  0:34     ` [PATCH] checkpatch: prefer dev_<level>( to dev_printk(KERN_<LEVEL> Bjorn Helgaas
2013-01-03  0:39       ` Joe Perches
2013-01-03 10:08     ` Andy Whitcroft
2013-01-03 16:28       ` Joe Perches
2013-01-03 16:49         ` [PATCH V2] " Joe Perches

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=1357169259.25181.9.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=jiang.liu@huawei.com \
    --cc=lance.ortiz@hp.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

all inboxes | Powered by JetHome®