From: Wei Liu Subject: Re: [[PATCH v4]] new functions libxl_bitmap_{or,and} Date: Tue, 14 Apr 2015 17:33:07 +0100 Message-ID: <20150414163307.GA8128@zion.uk.xensource.com> References: <1429020479-21594-1-git-send-email-lindaj@jma3.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1429020479-21594-1-git-send-email-lindaj@jma3.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Linda Jacobson Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, lars.kurth.xen@gmail.com, xen-devel@lists.xen.org, julien.grall@citrix.com, ian.jackson@citrix.com List-Id: xen-devel@lists.xenproject.org Urgh... I think I made a mistake in the rune I gave you, sorry. The --subject-prefix= doesn't need to include "[]". And you forgot to change the subject line to libxl: provide libxl_bitmap_{and,or} I'm a picky about the subject line because this is what shows up when you look at git commit log. On Tue, Apr 14, 2015 at 08:07:59AM -0600, Linda Jacobson wrote: > provide logical and and or of two bitmaps Provide logical and and or of two bitmaps. This should be a proper sentence. Other than these minor nits the code logic looks OK. > > Signed-off-by: Linda Jacobson > > --- > [...] > +int libxl_bitmap_and(libxl_ctx *ctx, libxl_bitmap *and_map, > + const libxl_bitmap *map1, const libxl_bitmap *map2) > +{ > + GC_INIT(ctx); > + int rc; > + uint32_t i; > + const libxl_bitmap *large_map; > + const libxl_bitmap *small_map; > + > + if (map1->size > map2->size) { > + large_map = map1; > + small_map = map2; > + } else { > + large_map = map2; > + small_map = map1; > + } > + > + We only need one blank line here. > + rc = libxl_bitmap_alloc(ctx, and_map, small_map->size * 8); > + if (rc) > + goto out; > + > + /* > + * If bitmaps aren't same size, their 'and' will be size of > + * smaller bit map > + */ > + for (i = 0; i < and_map->size; i++) > + and_map->map[i] = (large_map->map[i] & small_map->map[i]); > + > +out: > + GC_FREE; > + return rc; > + No need to have blank lines after "return rc;" Wei.