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-devel

[Xen-devel] [PATCH][LINUX] fix 64 bit build warning in privcmd_ioctl()

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][LINUX] fix 64 bit build warning in privcmd_ioctl()
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Fri, 10 Nov 2006 12:33:48 -0500
Delivery-date: Fri, 10 Nov 2006 09:34:01 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The following patch fixes a build warning on when sizeof(long) > sizeof(int).

Actuall gcc message:
xen/linux/linux-2.6/drivers/xen/privcmd/privcmd.c: In function 'privcmd_ioctl': xen/linux/linux-2.6/drivers/xen/privcmd/privcmd.c:180: warning: comparison is always false due to limited range of data type

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>

diff -r 4d4f0d52c193 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Thu Nov 09 15:37:17 2006 -0500 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Fri Nov 10 12:29:04 2006 -0500
@@ -174,7 +174,7 @@ 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)))
+               if ((m.num <= 0) || (m.num > (INT_MAX >> PAGE_SHIFT)))
                        return -EINVAL;
                down_read(&mm->mmap_sem);


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][LINUX] fix 64 bit build warning in privcmd_ioctl(), Jimi Xenidis <=