From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAWVt-0002Wq-7r for qemu-devel@nongnu.org; Thu, 11 Oct 2018 04:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAWVp-0001uo-5y for qemu-devel@nongnu.org; Thu, 11 Oct 2018 04:40:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAWVo-0001tn-Sr for qemu-devel@nongnu.org; Thu, 11 Oct 2018 04:40:05 -0400 Date: Thu, 11 Oct 2018 09:39:55 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20181011083954.GA2483@work-vm> References: <20181009205652.10605-1-david@redhat.com> <20181009205652.10605-4-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181009205652.10605-4-david@redhat.com> Subject: Re: [Qemu-devel] [PATCH v1 3/7] range: pass const pointer where possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" , Igor Mammedov , Markus Armbruster , Michael Roth , David Gibson , Eduardo Habkost * David Hildenbrand (david@redhat.com) wrote: > If there are no changes, let's use a const pointer. > > Signed-off-by: David Hildenbrand Reviewed-by: Dr. David Alan Gilbert > --- > include/qemu/range.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/qemu/range.h b/include/qemu/range.h > index f28f0c1825..7e75f4e655 100644 > --- a/include/qemu/range.h > +++ b/include/qemu/range.h > @@ -39,7 +39,7 @@ struct Range { > uint64_t upb; /* inclusive upper bound */ > }; > > -static inline void range_invariant(Range *range) > +static inline void range_invariant(const Range *range) > { > assert(range->lob <= range->upb || range->lob == range->upb + 1); > } > @@ -48,14 +48,14 @@ static inline void range_invariant(Range *range) > #define range_empty ((Range){ .lob = 1, .upb = 0 }) > > /* Is @range empty? */ > -static inline bool range_is_empty(Range *range) > +static inline bool range_is_empty(const Range *range) > { > range_invariant(range); > return range->lob > range->upb; > } > > /* Does @range contain @val? */ > -static inline bool range_contains(Range *range, uint64_t val) > +static inline bool range_contains(const Range *range, uint64_t val) > { > return val >= range->lob && val <= range->upb; > } > -- > 2.17.1 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK