Patchwork [v2,3/6] range: add min/max operations on ranges

login
register
mail settings
Submitter Michael S. Tsirkin
Date Sept. 15, 2013, 8:49 a.m.
Message ID <20130915084929.GA31654@redhat.com>
Download mbox | patch
Permalink /patch/275010/
State New
Headers show

Comments

Michael S. Tsirkin - Sept. 15, 2013, 8:49 a.m.
On Sun, Sep 15, 2013 at 11:46:44AM +0300, Michael S. Tsirkin wrote:
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Actually I applied the following on top - not going to
repost as that just adds a comment.

Patch

diff --git a/include/qemu/range.h b/include/qemu/range.h
index 1c688ca..aae9720 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -29,6 +29,7 @@  static inline void range_extend(Range *range, Range *extend_by)
     if (range->begin > extend_by->begin) {
         range->begin = extend_by->begin;
     }
+    /* Compare last byte in case region ends at ~0x0LL */
     if (range->end - 1 < extend_by->end - 1) {
         range->end = extend_by->end;
     }