public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux•vnet.ibm.com>
To: David Laight <David.Laight@aculab•com>
Cc: "linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>,
	'Gavin Shan' <gwshan@linux•vnet.ibm.com>
Subject: Re: [PATCH 3/6] powerpc/eeh: Reduce lines of log dump
Date: Wed, 16 Jul 2014 22:26:53 +1000	[thread overview]
Message-ID: <20140716122653.GB5313@shangw> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D17274752@AcuExch.aculab.com>

On Wed, Jul 16, 2014 at 08:30:55AM +0000, David Laight wrote:
>From: Gavin Shan
>> The patch prints 4 PCIE or AER config registers each line, which
>> is part of the EEH log so that it looks a bit more compact.
>...
>> -		for (i=0; i<=8; i++) {
>> +		for (i=0, j=0; i<=8; i++) {
>>  			eeh_ops->read_config(dn, cap+4*i, 4, &cfg);
>>  			n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg);
>> -			pr_warn("EEH: PCI-E %02x: %08x\n", i, cfg);
>> +
>> +			if ((i % 4) == 0) {
>> +				memset(buffer, 0, sizeof(buffer));

>
>You don't need a memset().
>I would add:
>				if (i != 0)
>					pr_warn("%s\n", buffer);
>and move the other pr_warn() outside the loop.
>

Thanks, It looks better. I'll fix.

>> +				j = scnprintf(buffer, sizeof(buffer),
>> +					      "EEH: PCI-E %02x: %08x ",
>> +					      4*i, cfg);
>> +			} else {
>> +				j += scnprintf(buffer+j, sizeof(buffer)-j,
>> +					       "%08x ", cfg);
>> +			}
>> +
>> +			if ((i % 4) == 3 || i >= 8)
>> +				pr_warn("%s\n", buffer);
>>  		}
>>  	}
>
>	David
>

Thanks,
Gavin

  reply	other threads:[~2014-07-16 12:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  5:50 [PATCH 0/6] EEH Cleanup Gavin Shan
2014-07-16  5:50 ` [PATCH 1/6] powerpc/eeh: Refactor EEH flag accessors Gavin Shan
2014-07-16  8:24   ` David Laight
2014-07-16 12:10     ` Gavin Shan
2014-07-16  5:50 ` [PATCH 2/6] powerpc/eeh: Selectively enable IO for error log Gavin Shan
2014-07-16  5:50 ` [PATCH 3/6] powerpc/eeh: Reduce lines of log dump Gavin Shan
2014-07-16  8:30   ` David Laight
2014-07-16 12:26     ` Gavin Shan [this message]
2014-07-16  5:50 ` [PATCH 4/6] powerpc/eeh: Replace pr_warning() with pr_warn() Gavin Shan
2014-07-16  5:50 ` [PATCH 5/6] powerpc/eeh: Make diag-data not endian dependent Gavin Shan
2014-07-16  5:50 ` [PATCH 6/6] powerpc/eeh: Aux PE data for error log Gavin Shan

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=20140716122653.GB5313@shangw \
    --to=gwshan@linux$(echo .)vnet.ibm.com \
    --cc=David.Laight@aculab$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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