Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Fix hid_get_data() and hid_get_udata() for 32-bi...
details: https://anonhg.NetBSD.org/src/rev/c8462416e1ab
branches: trunk
changeset: 342639:c8462416e1ab
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Sat Jan 02 20:45:07 2016 +0000
description:
Fix hid_get_data() and hid_get_udata() for 32-bit quantities on LP64.
Previously it would always return 0.
diffstat:
sys/dev/usb/hid.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (39 lines):
diff -r 8c6d82e953b8 -r c8462416e1ab sys/dev/usb/hid.c
--- a/sys/dev/usb/hid.c Sat Jan 02 20:35:59 2016 +0000
+++ b/sys/dev/usb/hid.c Sat Jan 02 20:45:07 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hid.c,v 1.36 2015/02/08 23:43:14 jmcneill Exp $ */
+/* $NetBSD: hid.c,v 1.37 2016/01/02 20:45:07 jakllsch Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.36 2015/02/08 23:43:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.37 2016/01/02 20:45:07 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -434,9 +434,9 @@
return (0);
data = hid_get_udata(buf, loc);
- if (data < (1 << (hsize - 1)))
+ if (data < (1UL << (hsize - 1)))
return (data);
- return data - (1 << hsize);
+ return data - (1UL << hsize);
}
u_long
@@ -458,7 +458,7 @@
data |= buf[off + i] << (i * 8);
data >>= hpos % 8;
- data &= (1 << hsize) - 1;
+ data &= (1UL << hsize) - 1;
DPRINTFN(10,("hid_get_udata: loc %d/%d = %lu\n", hpos, hsize, data));
return (data);
Home |
Main Index |
Thread Index |
Old Index