public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harry Ciao <qingtao.cao@windriver.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, bluesmoke-devel@lists.sourceforge.net
Subject: Re: [v1 PATCH 3/8] EDAC: AMD8111 driver source file
Date: Wed, 11 Mar 2009 10:15:19 +0800	[thread overview]
Message-ID: <49B71EB7.8090205@windriver.com> (raw)
In-Reply-To: <20090310134607.1915c53c.akpm@linux-foundation.org>

Andrew Morton 写道:
> On Mon,  9 Mar 2009 16:08:12 +0800
> Harry Ciao <qingtao.cao@windriver.com> wrote:
>
>   
>> Introduce AMD8111 EDAC driver source file, which makes use of error
>> detections on the LPC Bridge Controller and PCI Bridge Controller on
>> the AMD8111 HyperTransport I/O Hub.
>>
>>
>> ...
>>
>> +/* Wrapper functions for accessing PCI configuration space */
>> +static int edac_pci_read_dword(struct pci_dev *dev, int reg, u32 *val32)
>> +{
>> +	int ret;
>> +
>> +	ret = pci_read_config_dword(dev, reg, val32);
>> +	if (ret > 0)
>> +		printk(KERN_ERR AMD8111_EDAC_MOD_STR
>> +			" PCI Access Read Error at 0x%x\n", reg);
>> +
>> +	return ret;
>> +}
>>
>> +static void edac_pci_read_byte(struct pci_dev *dev, int reg, u8 *val8)
>> +{
>> +	int ret;
>> +
>> +	ret = pci_read_config_byte(dev, reg, val8);
>> +	if (ret > 0)
>> +		printk(KERN_ERR AMD8111_EDAC_MOD_STR
>> +			" PCI Access Read Error at 0x%x\n", reg);
>> +}
>> +
>> +static void edac_pci_write_dword(struct pci_dev *dev, int reg, u32 val32)
>> +{
>> +	int ret;
>> +
>> +	ret = pci_write_config_dword(dev, reg, val32);
>> +	if (ret > 0)
>> +		printk(KERN_ERR AMD8111_EDAC_MOD_STR
>> +			" PCI Access Write Error at 0x%x\n", reg);
>> +}
>> +
>> +static void edac_pci_write_byte(struct pci_dev *dev, int reg, u8 val8)
>> +{
>> +	int ret;
>> +
>> +	ret = pci_write_config_byte(dev, reg, val8);
>> +	if (ret > 0)
>> +		printk(KERN_ERR AMD8111_EDAC_MOD_STR
>> +			" PCI Access Write Error at 0x%x\n", reg);
>> +}
>>     
>
>
> <spends a while trying to work out what the return value of
> pci_read_config_dword() means>
>
> <gets frustrated and gives up>
>
> Is it correct that all of these functions treat a +ve return value as
> an error?
>
>   
Hi Andrew,

I should have compared the ret with zero, anything other than zero would 
be treated as an error code. My mistake is resulted from the fact that 
for the time being the return value of these wrappers have not been used 
yet, they are used nothing but to print some error messages.

I will correct this in the v2 series of patches.

Best regards,

Harry


>> ...
>>
>>     
>
>   


  reply	other threads:[~2009-03-11  2:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  8:08 [v1 PATCH 0/8] Add AMD8111 and AMD8131 EDAC drivers Harry Ciao
2009-03-09  8:08 ` [v1 PATCH 1/8] EDAC: AMD8111 driver Kconfig & Makefile Harry Ciao
2009-03-09  8:08   ` [v1 PATCH 2/8] EDAC: AMD8111 driver header file Harry Ciao
2009-03-09  8:08     ` [v1 PATCH 3/8] EDAC: AMD8111 driver source file Harry Ciao
2009-03-09  8:08       ` [v1 PATCH 4/8] EDAC: Add edac_pci_alloc_index() Harry Ciao
2009-03-09  8:08         ` [v1 PATCH 5/8] PCI: Add AMD8111 PCI Bridge PCI Device ID Harry Ciao
2009-03-09  8:08           ` [v1 PATCH 6/8] EDAC: AMD8131 driver header file Harry Ciao
2009-03-09  8:08             ` [v1 PATCH 7/8] EDAC: AMD8131 driver source file Harry Ciao
2009-03-09  8:08               ` [v1 PATCH 8/8] EDAC: AMD8131 driver Kconfig & Makefile Harry Ciao
2009-03-10 20:46       ` [v1 PATCH 3/8] EDAC: AMD8111 driver source file Andrew Morton
2009-03-11  2:15         ` Harry Ciao [this message]
2009-03-09  9:04   ` [v1 PATCH 1/8] EDAC: AMD8111 driver Kconfig & Makefile Bert Wesarg
2009-03-11  1:05     ` Harry Ciao
  -- strict thread matches above, loose matches on Subject: below --
2009-03-11 18:55 [v1 PATCH 3/8] EDAC: AMD8111 driver source file Doug Thompson
2009-03-11 19:08 ` Andrew Morton

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=49B71EB7.8090205@windriver.com \
    --to=qingtao.cao@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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