Am 01.07.2011 15:06, schrieb Fam Zheng: >> >> bdrv_pread only ever returns 0 for success or -errno for errors. So you >> can simplify the code like this: >> >> ret = bdrv_pread(...); >> if (ret < 0) { >> goto fail_l1; >> } >> >> You have the same pattern in other places, too. > > I think bdrv_pead do return the read bytes, did you mean bdrv_read here? :)
Yes, you're right, it returns the read bytes. But it's always -errno or the full byte count, there are no short reads. So my explanation wasn't quite right, but the suggestion stays the same. :-) Kevin