From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Keir Fraser <keir@xen.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH] rangeset: "has" and "is" functions return boolean
Date: Tue, 9 Jun 2015 10:00:46 +0100 [thread overview]
Message-ID: <1433840446.7108.529.camel@citrix.com> (raw)
In-Reply-To: <5576C4570200007800082740@mail.emea.novell.com>
On Tue, 2015-06-09 at 09:47 +0100, Jan Beulich wrote:
> Additionally rangeset_is_empty()'s sole parameter can be const.
Isn't that true of all/most of the others touched here too? (Once the
underlying range_* list manipulations are made const correct).
If you do decide to go further then there is a "implemnetation" typo in
there too.
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
So far as it goes:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
> --- a/xen/common/rangeset.c
> +++ b/xen/common/rangeset.c
> @@ -248,11 +248,11 @@ int rangeset_remove_range(
> return rc;
> }
>
> -int rangeset_contains_range(
> +bool_t rangeset_contains_range(
> struct rangeset *r, unsigned long s, unsigned long e)
> {
> struct range *x;
> - int contains;
> + bool_t contains;
>
> ASSERT(s <= e);
>
> @@ -264,11 +264,11 @@ int rangeset_contains_range(
> return contains;
> }
>
> -int rangeset_overlaps_range(
> +bool_t rangeset_overlaps_range(
> struct rangeset *r, unsigned long s, unsigned long e)
> {
> struct range *x;
> - int overlaps;
> + bool_t overlaps;
>
> ASSERT(s <= e);
>
> @@ -310,14 +310,14 @@ int rangeset_remove_singleton(
> return rangeset_remove_range(r, s, s);
> }
>
> -int rangeset_contains_singleton(
> +bool_t rangeset_contains_singleton(
> struct rangeset *r, unsigned long s)
> {
> return rangeset_contains_range(r, s, s);
> }
>
> -int rangeset_is_empty(
> - struct rangeset *r)
> +bool_t rangeset_is_empty(
> + const struct rangeset *r)
> {
> return ((r == NULL) || list_empty(&r->range_list));
> }
> --- a/xen/include/xen/rangeset.h
> +++ b/xen/include/xen/rangeset.h
> @@ -10,6 +10,8 @@
> #ifndef __XEN_RANGESET_H__
> #define __XEN_RANGESET_H__
>
> +#include <xen/types.h>
> +
> struct domain;
> struct rangeset;
>
> @@ -50,17 +52,17 @@ void rangeset_limit(
> #define _RANGESETF_prettyprint_hex 0
> #define RANGESETF_prettyprint_hex (1U << _RANGESETF_prettyprint_hex)
>
> -int __must_check rangeset_is_empty(
> - struct rangeset *r);
> +bool_t __must_check rangeset_is_empty(
> + const struct rangeset *r);
>
> /* Add/remove/query a numeric range. */
> int __must_check rangeset_add_range(
> struct rangeset *r, unsigned long s, unsigned long e);
> int __must_check rangeset_remove_range(
> struct rangeset *r, unsigned long s, unsigned long e);
> -int __must_check rangeset_contains_range(
> +bool_t __must_check rangeset_contains_range(
> struct rangeset *r, unsigned long s, unsigned long e);
> -int __must_check rangeset_overlaps_range(
> +bool_t __must_check rangeset_overlaps_range(
> struct rangeset *r, unsigned long s, unsigned long e);
> int rangeset_report_ranges(
> struct rangeset *r, unsigned long s, unsigned long e,
> @@ -71,7 +73,7 @@ int __must_check rangeset_add_singleton(
> struct rangeset *r, unsigned long s);
> int __must_check rangeset_remove_singleton(
> struct rangeset *r, unsigned long s);
> -int __must_check rangeset_contains_singleton(
> +bool_t __must_check rangeset_contains_singleton(
> struct rangeset *r, unsigned long s);
>
> /* swap contents */
>
>
>
next prev parent reply other threads:[~2015-06-09 9:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 8:47 [PATCH] rangeset: "has" and "is" functions return boolean Jan Beulich
2015-06-09 8:57 ` Dario Faggioli
2015-06-09 9:00 ` Ian Campbell [this message]
2015-06-09 9:15 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433840446.7108.529.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.