From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XspfG-00027F-B5 for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:10:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XspfA-0002tx-1H for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:10:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xspf9-0002th-Ps for qemu-devel@nongnu.org; Mon, 24 Nov 2014 04:10:27 -0500 Date: Mon, 24 Nov 2014 09:10:20 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20141124091019.GA2404@work-vm> References: <546F7FBA.6020307@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <546F7FBA.6020307@gmail.com> 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: Gary R Hook Cc: stefanha@gmail.com, qemu-devel@nongnu.org * Gary R Hook (grhookatwork@gmail.com) wrote: > 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!" Please resubmit it, especially with the correct Signed-off-by Dave > > -- > Gary R Hook > Senior Kernel Engineer > NIMBOXX, Inc > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK