From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrsdr-0007eE-AC for qemu-devel@nongnu.org; Fri, 21 Nov 2014 13:09:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrsdg-00056s-Ch for qemu-devel@nongnu.org; Fri, 21 Nov 2014 13:09:11 -0500 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:62841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrsdg-00056L-7O for qemu-devel@nongnu.org; Fri, 21 Nov 2014 13:09:00 -0500 Received: by mail-oi0-f49.google.com with SMTP id i138so3974709oig.22 for ; Fri, 21 Nov 2014 10:08:59 -0800 (PST) Message-ID: <546F7FBA.6020307@gmail.com> Date: Fri, 21 Nov 2014 12:08:58 -0600 From: Gary R Hook MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com Stefan Hajnoczi 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