lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 11 Mar 2009 10:15:19 +0800
From:	Harry Ciao <qingtao.cao@...driver.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org, bluesmoke-devel@...ts.sourceforge.net
Subject: Re: [v1 PATCH 3/8] EDAC: AMD8111 driver source file

Andrew Morton 写道:
> On Mon,  9 Mar 2009 16:08:12 +0800
> Harry Ciao <qingtao.cao@...driver.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


>> ...
>>
>>     
>
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ