From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linda Subject: Re: [[PATCH v4]] new functions libxl_bitmap_{or,and} Date: Wed, 15 Apr 2015 05:07:44 -0600 Message-ID: <552E4680.9010905@jma3.com> References: <1429020479-21594-1-git-send-email-lindaj@jma3.com> <20150414163307.GA8128@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150414163307.GA8128@zion.uk.xensource.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: Wei Liu Cc: 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 Not ignored. Sorry. I shouldn't have read from my iPhone. I didn't see the others. I'll take care of them. Linda On 4/14/2015 10:33 AM, Wei Liu wrote: > 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. >