WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix byte-to-long bitmap conversions.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix byte-to-long bitmap conversions.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Jan 2007 08:50:09 -0800
Delivery-date: Mon, 22 Jan 2007 08:50:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Date 1169399458 0
# Node ID 7c455af5998a72953f7e4472ae943cb8794f2e57
# Parent  c1f23d09285e0d57c516bec8333982ffdb945d4d
Fix byte-to-long bitmap conversions.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_private.c |    3 +--
 xen/common/bitmap.c      |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff -r c1f23d09285e -r 7c455af5998a tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Sun Jan 21 16:29:18 2007 +0000
+++ b/tools/libxc/xc_private.c  Sun Jan 21 17:10:58 2007 +0000
@@ -525,8 +525,7 @@ void bitmap_byte_to_64(uint64_t *lp, con
     for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
         l = 0;
         for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
-            l <<= 8;
-            l |= bp[b+j];
+            l |= (uint64_t)bp[b+j] << (j*8);
             nbits -= 8;
         }
         lp[i] = l;
diff -r c1f23d09285e -r 7c455af5998a xen/common/bitmap.c
--- a/xen/common/bitmap.c       Sun Jan 21 16:29:18 2007 +0000
+++ b/xen/common/bitmap.c       Sun Jan 21 17:10:58 2007 +0000
@@ -494,8 +494,7 @@ void bitmap_byte_to_long(unsigned long *
        for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
                l = 0;
                for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
-                       l <<= 8;
-                       l |= bp[b+j];
+                       l |= (unsigned long)bp[b+j] << (j*8);
                        nbits -= 8;
                }
                lp[i] = l;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix byte-to-long bitmap conversions., Xen patchbot-unstable <=