Received: from eggs.gnu.org ([2001:4830:134:3::10]:47224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0ND5-0003wK-Ei for qemu-devel@nongnu.org; Thu, 26 Jun 2014 23:52:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0ND1-0003nC-6c for qemu-devel@nongnu.org; Thu, 26 Jun 2014 23:52:23 -0400 Received: from [59.151.112.132] (port=33125 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0ND0-0003n2-RA for qemu-devel@nongnu.org; Thu, 26 Jun 2014 23:52:19 -0400 Date: Fri, 27 Jun 2014 11:50:20 +0800 From: Hu Tao Message-ID: <20140627035020.GD4030@G08FNSTD100614.fnst.cn.fujitsu.com> References: <1403763216-28508-1-git-send-email-hutao@cn.fujitsu.com> <53AC5085.9040605@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <53AC5085.9040605@redhat.com> Subject: Re: [Qemu-devel] [PATCH] cleanup of ROUND_UP-like lines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org On Thu, Jun 26, 2014 at 10:55:33AM -0600, Eric Blake wrote: > On 06/26/2014 12:13 AM, Hu Tao wrote: > > We already have ROUND_UP but there are similar macros and ROUND_UP-like > > lines all around, replace them with ROUND_UP and clean up similar macros. > > > > Signed-off-by: Hu Tao > > --- > > All of these conversions are correct, so: > Reviewed-by: Eric Blake Thanks for review! > > However, without documenting how you found what to convert, I'm quite > sure you missed some conversions. In fact, I found at least: > > util/oslib-win32.c: memory = (memory + pagesize - 1) & -pagesize; The pattern I used is '(.*+.*\-.*\&.*~'. Apparently I forgot the -pagesize case. > > tcg/ppc/tcg-target.c-#define FRAME_SIZE ((TCG_TARGET_CALL_STACK_OFFSET \ > tcg/ppc/tcg-target.c- + TCG_STATIC_CALL_ARGS_SIZE \ > tcg/ppc/tcg-target.c- + CPU_TEMP_BUF_SIZE \ > tcg/ppc/tcg-target.c- + REG_SAVE_SIZE \ > tcg/ppc/tcg-target.c- + TCG_TARGET_STACK_ALIGN - 1) \ > tcg/ppc/tcg-target.c: & -TCG_TARGET_STACK_ALIGN) How did you find this one? Your pattern below just shows the last line. > > block/cow.c: s->cow_sectors_offset = (bitmap_size + 511) & ~511; > > block/qcow.c: header_size = (header_size + 7) & ~7; > > before I quit looking for more. (I just manually read through > git grep '[^&]& [~-]' > which has a lot of noise for non-rounding uses, but definitely found > some missed cases) > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >