From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH kvm-unit-tests v2 02/17] libcflat: introduce is_power_of_2() Date: Mon, 14 Nov 2016 15:14:07 -0500 Message-ID: <20161114201407.GA3125@pxdev.xzpeter.org> References: <1478704224-20472-1-git-send-email-peterx@redhat.com> <1478704224-20472-3-git-send-email-peterx@redhat.com> <20161110182000.445ysavw7x2db4es@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, rkrcmar@redhat.com, agordeev@redhat.com, jan.kiszka@web.de, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47080 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935180AbcKNUOK (ORCPT ); Mon, 14 Nov 2016 15:14:10 -0500 Content-Disposition: inline In-Reply-To: <20161110182000.445ysavw7x2db4es@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 10, 2016 at 07:20:00PM +0100, Andrew Jones wrote: > On Wed, Nov 09, 2016 at 10:10:09AM -0500, Peter Xu wrote: > > Suggested-by: Andrew Jones > > Signed-off-by: Peter Xu > > --- > > lib/libcflat.h | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/lib/libcflat.h b/lib/libcflat.h > > index 72b1bf9..19bd0c6 100644 > > --- a/lib/libcflat.h > > +++ b/lib/libcflat.h > > @@ -103,4 +103,9 @@ do { \ > > } \ > > } while (0) > > > > +static inline bool is_power_of_2(unsigned long n) > > +{ > > + return (n && !(n & (n - 1))); > > nit: outer () are unnecessary Will fix. > > > +} > > + > > #endif > > Reviewed-by: Andrew Jones Thanks, -- peterx