qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch


From: Gary R Hook
Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch
Date: Fri, 21 Nov 2014 12:08:58 -0600
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Stefan Hajnoczi <address@hidden> writes:

> On Wed, Nov 12, 2014 at 06:48:18PM +0000, Gary Hook wrote:
>> -    return qemu_ftell(f) - last_ftell;
>> +    delta_ftell = qemu_ftell(f) - last_ftell;
>> +    return( (delta_ftell > 0) ? 1 : (delta_ftell < 0) ? -1 : 0 );
>
> Good find!
>
> Please don't nest the ternary operator, it is hard to read.
>
> if (delta_ftell < 0) {
>     return -1;
> } else if (delta_ftell > 0) {
>     return 1;
> } else {
>     return 0;
> }

So now that it's clear that I fully botched the patch submission, I would like to follow up: shall I resubmit this change?

I don't see this fix in the current source (which makes sense due to the 2.2 RC2 work) but folks are asking. And it appears that there's a bug report over at RedHat that may be the same problem.

I think I'll add to my .sig: "Look, ma, only 72 columns!"

--
Gary R Hook
Senior Kernel Engineer
NIMBOXX, Inc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]