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] [PRIVCMD] Fix build warning when sizeof(l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [PRIVCMD] Fix build warning when sizeof(long) > sizeof(int).
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Nov 2006 09:10:16 +0000
Delivery-date: Sat, 11 Nov 2006 01:10:15 -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
# Node ID b1d436f094faa1a681f94497ddf6a84b15e7d493
# Parent  825be74657c314c7b73f8f1cdb39a4445aace2ea
[PRIVCMD] Fix build warning when sizeof(long) > sizeof(int).
Original patch from Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 825be74657c3 -r b1d436f094fa 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Sat Nov 11 
01:25:00 2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Sat Nov 11 
01:40:16 2006 +0000
@@ -165,7 +165,7 @@ static int privcmd_ioctl(struct inode *i
                struct mm_struct *mm = current->mm;
                struct vm_area_struct *vma;
                xen_pfn_t __user *p;
-               unsigned long addr, mfn;
+               unsigned long addr, mfn, nr_pages;
                int i;
 
                if (!is_initial_xendomain())
@@ -174,7 +174,8 @@ static int privcmd_ioctl(struct inode *i
                if (copy_from_user(&m, udata, sizeof(m)))
                        return -EFAULT;
 
-               if ((m.num <= 0) || (m.num > (LONG_MAX >> PAGE_SHIFT)))
+               nr_pages = m.num;
+               if ((m.num <= 0) || (nr_pages > (LONG_MAX >> PAGE_SHIFT)))
                        return -EINVAL;
 
                down_read(&mm->mmap_sem);
@@ -182,8 +183,7 @@ static int privcmd_ioctl(struct inode *i
                vma = find_vma(mm, m.addr);
                if (!vma ||
                    (m.addr != vma->vm_start) ||
-                   ((m.addr + ((unsigned long)m.num<<PAGE_SHIFT)) !=
-                    vma->vm_end) ||
+                   ((m.addr + (nr_pages << PAGE_SHIFT)) != vma->vm_end) ||
                    !privcmd_enforce_singleshot_mapping(vma)) {
                        up_read(&mm->mmap_sem);
                        return -EINVAL;
@@ -191,7 +191,7 @@ static int privcmd_ioctl(struct inode *i
 
                p = m.arr;
                addr = m.addr;
-               for (i = 0; i < m.num; i++, addr += PAGE_SIZE, p++) {
+               for (i = 0; i < nr_pages; i++, addr += PAGE_SIZE, p++) {
                        if (get_user(mfn, p)) {
                                up_read(&mm->mmap_sem);
                                return -EFAULT;

_______________________________________________
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] [PRIVCMD] Fix build warning when sizeof(long) > sizeof(int)., Xen patchbot-unstable <=