Re: [PATCH v6 4/6] transaction: add TRANSACTION_CREATE_EXISTS error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



karthik nayak <karthik.188@xxxxxxxxx> writes:

>> +			} else {
>> +				int checkret;
>> +				checkret = check_old_oid(update, &lock->old_oid, err);
>> +				if  (checkret) {
>> +					ret = checkret;
>> +					goto out;
>> +				}
>
> Can't we simply do:
>
>   ret = check_old_oid(update, &lock->old_oid, err);
>   if (ret) {
>      goto out
>   }
>
> if ret is '0', it shouldn't matter no?

That's nice.  Yes, as long as "ret" has no useful information when
we enter this "else" block, reusing it like you did is just fine.

This is one of these moments I tell myself "oh, why didn't *I* think
of that" ;-).

Thanks.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux