lkml.org 
[lkml]   [2012]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v6 3/3] aerdrv: Cleanup log output for CPER based AER
Date
> Hi again Lance.
>
> > diff --git 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;
>
> Perhaps this would be better just using dev_printk
> instead of snprintf into a prefix with printk to
> emulate dev_printk.
>
> Also, perhaps KERN_NOTICE is preferable to KERN_WARNING
> in the CORRECTABLE case.
>
> Maybe something like:
>
> const char *level = KERN_ERR;
> if (aer_severity == AER_CORRECTABLE)
> level = KERN_NOTICE;
>
> ...
>
> dev_printk(level, &dev->dev, etc...);
>
> Maybe do this after this series of patches is accepted.
> Enough with the revisions for awhile...

Hi Joe,

The reason I did it this way was I was trying to be consistent with what was done for the AER interrupt case. The function aer_print_error()in the same file uses sprintf this way. I'm not sure why they chose that instead of dev_printk. I think if we did make the change we should do it in both places to keep them the same.

Lance


\
 
 \ /
  Last update: 2012-12-04 22:01    [W:0.047 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site