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:	Fri, 02 Sep 2011 10:11:13 +0100
From:	Jonathan Cameron <jic23@....ac.uk>
To:	Dan Carpenter 
	<public-error27-Re5JQEeQqe8AvxtiuMwx3w@...ne.gmane.org>
CC:	"Maxin B. John" 
	<public-maxin.john-Re5JQEeQqe8AvxtiuMwx3w@...ne.gmane.org>,
	Amit Kucheria 
	<public-amit.kucheria-LY4KaoCqKrnby3iVrkZq2A@...ne.gmane.org>,
	public-devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@...ne.gmane.org,
	Arnd Bergmann <public-arnd-r2nGTMty4D4@...ne.gmane.org>,
	public-linux-iio-u79uwXL29TY76Z2rM5mHXA@...ne.gmane.org,
	Greg Kroah-Hartman <public-gregkh-l3A5Bk7waGM@...ne.gmane.org>,
	public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@...ne.gmane.org,
	Bryan Freed 
	<public-bfreed-F7+t8E8rja9g9hUCZPvPmw@...ne.gmane.org>,
	Jonathan Cameron 
	<public-jic23-KWPb1pKIrIJaa/9Udqfwiw@...ne.gmane.org>
Subject: Re: [PATCH] staging: iio: light: Fix compiler warning in tsl2563.c



On 09/01/11 22:55, Dan Carpenter wrote:
> On Fri, Sep 02, 2011 at 12:24:13AM +0300, Maxin B. John wrote:
>> --- a/drivers/staging/iio/light/tsl2563.c
>> +++ b/drivers/staging/iio/light/tsl2563.c
>> @@ -225,9 +225,9 @@ static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id)
>>  
>>  	ret = i2c_smbus_read_byte_data(client, TSL2563_CMD | TSL2563_REG_ID);
>>  	if (ret < 0)
>> -		return ret;
>> +		return -EIO;
> 
> Don't overwrite the error code.  For example, the lower layers can
> return -EAGAIN and that's more useful than just returning -EIO every
> time.
> 
> Your fix works, but it's not very clean.  Just add a "*id = ret;"
> line before the "return 0;" and that's it.  (It doesn't make sense
> to pass a pointer to "id" and not use it).
> 
> (In other words, don't make any changes to the tsl2563_probe()
> function)
> 
>>  
>> -	return 0;
>> +	return ret;
>>  }
>> 
Yikes - I wonder why my various compilers don't throw that up.
Ah well Dan's fix is indeed the right one and what was intended.

Thanks,

Jonathan

--
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