summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/io/vuidmice
diff options
context:
space:
mode:
authorgd78059 <none@none>2008-07-01 11:22:16 -0700
committergd78059 <none@none>2008-07-01 11:22:16 -0700
commit22eb7cb54d8a6bcf6fe2674cb4b1f0cf2d85cfb6 (patch)
tree566d50817562c3269e1facc0905dcf7adf562774 /usr/src/uts/common/io/vuidmice
parent7f7c96a6a7060c462769ffdab973f2d77a5845b5 (diff)
downloadillumos-gate-22eb7cb54d8a6bcf6fe2674cb4b1f0cf2d85cfb6.tar.gz
6692913 MBLKL generates E_PTRDIFF_OVERFLOW lint warnings
6717598 MBLKSIZE() causes lint pointer-difference warnings
Diffstat (limited to 'usr/src/uts/common/io/vuidmice')
-rw-r--r--usr/src/uts/common/io/vuidmice/vuidm3p.c12
-rw-r--r--usr/src/uts/common/io/vuidmice/vuidm4p.c14
-rw-r--r--usr/src/uts/common/io/vuidmice/vuidm5p.c10
-rw-r--r--usr/src/uts/common/io/vuidmice/vuidmice.c51
-rw-r--r--usr/src/uts/common/io/vuidmice/vuidps2.c16
5 files changed, 54 insertions, 49 deletions
diff --git a/usr/src/uts/common/io/vuidmice/vuidm3p.c b/usr/src/uts/common/io/vuidmice/vuidm3p.c
index 073176c724..746abfcbc8 100644
--- a/usr/src/uts/common/io/vuidmice/vuidm3p.c
+++ b/usr/src/uts/common/io/vuidmice/vuidm3p.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -32,6 +31,7 @@
#include <sys/param.h>
#include <sys/stream.h>
+#include <sys/strsun.h>
#include <sys/vuid_event.h>
#include <sys/vuidmice.h>
@@ -90,7 +90,7 @@ vuidm3p_sendButtonEvent(queue_t *const qp)
if ((STATEP->buttons & mask) != (STATEP->oldbuttons & mask))
VUID_PUTNEXT(qp, VUID_BUT(b), FE_PAIR_NONE, 0,
- (STATEP->buttons & mask ? 1 : 0));
+ (STATEP->buttons & mask ? 1 : 0));
}
}
@@ -101,7 +101,7 @@ vuidm3p(queue_t *const qp, mblk_t *mp)
uchar_t *bufp;
bufp = mp->b_rptr;
- r = mp->b_wptr - mp->b_rptr;
+ r = MBLKL(mp);
for (r--; r >= 0; r--) {
code = *bufp++;
diff --git a/usr/src/uts/common/io/vuidmice/vuidm4p.c b/usr/src/uts/common/io/vuidmice/vuidm4p.c
index bb451b0508..9af020b4af 100644
--- a/usr/src/uts/common/io/vuidmice/vuidm4p.c
+++ b/usr/src/uts/common/io/vuidmice/vuidm4p.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -32,6 +31,7 @@
#include <sys/param.h>
#include <sys/stream.h>
+#include <sys/strsun.h>
#include <sys/vuid_event.h>
#include <sys/vuidmice.h>
@@ -99,7 +99,7 @@ vuidm4p(queue_t *const qp, mblk_t *mp)
unsigned char *bufp;
bufp = mp->b_rptr;
- r = mp->b_wptr - mp->b_rptr;
+ r = MBLKL(mp);
for (r--; r >= 0; r--) {
code = *bufp++;
@@ -134,7 +134,7 @@ vuidm4p(queue_t *const qp, mblk_t *mp)
/* Get the new state for the LEFT & RIGHT Button */
STATEP->buttons |=
- (code & (MOUSE_BUTTON_L | MOUSE_BUTTON_R));
+ (code & (MOUSE_BUTTON_L | MOUSE_BUTTON_R));
/*
* bits 0 & 1 are bits 6 & 7 of X value
@@ -170,7 +170,7 @@ vuidm4p(queue_t *const qp, mblk_t *mp)
STATEP->state = MOUSE_DELTA_Y;
STATEP->buttons |=
- (STATEP->oldbuttons & MOUSE_BUTTON_M);
+ (STATEP->oldbuttons & MOUSE_BUTTON_M);
/*
* If we can peek at the next two mouse characters,
diff --git a/usr/src/uts/common/io/vuidmice/vuidm5p.c b/usr/src/uts/common/io/vuidmice/vuidm5p.c
index ce0faa37fb..f05a38c849 100644
--- a/usr/src/uts/common/io/vuidmice/vuidm5p.c
+++ b/usr/src/uts/common/io/vuidmice/vuidm5p.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -32,6 +31,7 @@
#include <sys/param.h>
#include <sys/stream.h>
+#include <sys/strsun.h>
#include <sys/vuid_event.h>
#include <sys/vuidmice.h>
@@ -85,7 +85,7 @@ vuidm5p(queue_t *const qp, mblk_t *mp)
uchar_t *bufp;
bufp = mp->b_rptr;
- r = mp->b_wptr - mp->b_rptr;
+ r = MBLKL(mp);
for (r--; r >= 0; r--) {
code = *bufp++;
diff --git a/usr/src/uts/common/io/vuidmice/vuidmice.c b/usr/src/uts/common/io/vuidmice/vuidmice.c
index 6b05d64928..50182b5343 100644
--- a/usr/src/uts/common/io/vuidmice/vuidmice.c
+++ b/usr/src/uts/common/io/vuidmice/vuidmice.c
@@ -327,7 +327,7 @@ vuidmice_wput(queue_t *const qp, mblk_t *mp)
return (0);
case M_IOCTL: {
- struct iocblk *iocbp = (struct iocblk *)mp->b_rptr;
+ struct iocblk *iocbp = (void *)mp->b_rptr;
switch (iocbp->ioc_cmd) {
case VUIDSFORMAT:
@@ -348,7 +348,8 @@ vuidmice_wput(queue_t *const qp, mblk_t *mp)
return (0);
}
- format_type = *(int *)mp->b_cont->b_rptr;
+ format_type =
+ *(int *)(void *)mp->b_cont->b_rptr;
STATEP->format = (uchar_t)format_type;
iocbp->ioc_rval = 0;
iocbp->ioc_count = 0;
@@ -388,7 +389,8 @@ vuidmice_wput(queue_t *const qp, mblk_t *mp)
return (0);
}
- *(int *)mp->b_cont->b_rptr = (int)STATEP->format;
+ *(int *)(void *)mp->b_cont->b_rptr =
+ (int)STATEP->format;
mp->b_cont->b_wptr += sizeof (int);
iocbp->ioc_count = sizeof (int);
@@ -430,7 +432,8 @@ vuidmice_wput(queue_t *const qp, mblk_t *mp)
return (0);
}
- *(int *)mp->b_cont->b_rptr = (int)STATEP->nbuttons;
+ *(int *)(void *)mp->b_cont->b_rptr =
+ (int)STATEP->nbuttons;
mp->b_cont->b_wptr += sizeof (int);
iocbp->ioc_count = sizeof (int);
@@ -494,7 +497,7 @@ VUID_PUTNEXT(queue_t *const qp, uchar_t event_id, uchar_t event_pair_type,
drv_usecwait(10);
}
- fep = (Firm_event *)bp->b_wptr;
+ fep = (void *)bp->b_wptr;
fep->id = vuid_id_addr(VKEY_FIRST) | vuid_id_offset(event_id);
fep->pair_type = event_pair_type;
@@ -527,8 +530,8 @@ vuidmice_miocdata(queue_t *qp, mblk_t *mp)
int err = 0;
- copyresp = (struct copyresp *)mp->b_rptr;
- iocbp = (struct iocblk *)mp->b_rptr;
+ copyresp = (void *)mp->b_rptr;
+ iocbp = (void *)mp->b_rptr;
if (copyresp->cp_rval) {
err = EAGAIN;
@@ -550,8 +553,8 @@ vuidmice_miocdata(queue_t *qp, mblk_t *mp)
break;
case VUIDGWHEELINFO:
case VUIDGWHEELSTATE:
- ioctmp = (mblk_t *)copyresp->cp_private;
- Mouseioc = (Mouse_iocstate_t *)ioctmp->b_rptr;
+ ioctmp = copyresp->cp_private;
+ Mouseioc = (void *)ioctmp->b_rptr;
if (Mouseioc->ioc_state == GETSTRUCT) {
if (mp->b_cont == NULL) {
err = EINVAL;
@@ -594,8 +597,8 @@ vuidmice_miocdata(queue_t *qp, mblk_t *mp)
break;
case VUIDSWHEELSTATE:
case MSIOSRESOLUTION:
- ioctmp = (mblk_t *)copyresp->cp_private;
- Mouseioc = (Mouse_iocstate_t *)ioctmp->b_rptr;
+ ioctmp = copyresp->cp_private;
+ Mouseioc = (void *)ioctmp->b_rptr;
if (mp->b_cont == NULL) {
err = EINVAL;
@@ -614,7 +617,7 @@ vuidmice_miocdata(queue_t *qp, mblk_t *mp)
if (mp->b_cont) {
freemsg(mp->b_cont);
- mp->b_cont = (mblk_t *)NULL;
+ mp->b_cont = NULL;
}
freemsg(ioctmp);
iocbp->ioc_count = 0;
@@ -634,11 +637,11 @@ err:
mp->b_datap->db_type = M_IOCNAK;
if (mp->b_cont) {
freemsg(mp->b_cont);
- mp->b_cont = (mblk_t *)NULL;
+ mp->b_cont = NULL;
}
if (copyresp->cp_private) {
- freemsg((mblk_t *)copyresp->cp_private);
- copyresp->cp_private = (mblk_t *)NULL;
+ freemsg(copyresp->cp_private);
+ copyresp->cp_private = NULL;
}
iocbp->ioc_count = 0;
iocbp->ioc_error = err;
@@ -665,18 +668,19 @@ vuidmice_handle_wheel_resolution_ioctl(queue_t *qp, mblk_t *mp, int cmd)
mblk_t *ioctmp;
mblk_t *datap;
- struct iocblk *iocbp = (struct iocblk *)mp->b_rptr;
+ struct iocblk *iocbp = (void *)mp->b_rptr;
if (iocbp->ioc_count == TRANSPARENT) {
if (mp->b_cont == NULL)
return (EINVAL);
- useraddr = (caddr_t)*((caddr_t *)mp->b_cont->b_rptr);
+ useraddr = *((caddr_t *)(void *)mp->b_cont->b_rptr);
switch (cmd) {
case VUIDGWHEELCOUNT:
size = sizeof (int);
if ((datap = allocb(sizeof (int), BPRI_HI)) == NULL)
return (EAGAIN);
- *((int *)datap->b_wptr) = STATEP->vuid_mouse_mode;
+ *((int *)(void *)datap->b_wptr) =
+ STATEP->vuid_mouse_mode;
mcopyout(mp, NULL, size, NULL, datap);
qreply(qp, mp);
@@ -695,10 +699,10 @@ vuidmice_handle_wheel_resolution_ioctl(queue_t *qp, mblk_t *mp, int cmd)
break;
}
- if ((ioctmp = (mblk_t *)allocb(sizeof (Mouse_iocstate_t),
+ if ((ioctmp = allocb(sizeof (Mouse_iocstate_t),
BPRI_MED)) == NULL)
return (EAGAIN);
- Mouseioc = (Mouse_iocstate_t *)ioctmp->b_rptr;
+ Mouseioc = (void *)ioctmp->b_rptr;
Mouseioc->ioc_state = GETSTRUCT;
Mouseioc->u_addr = useraddr;
ioctmp->b_wptr = ioctmp->b_rptr + sizeof (Mouse_iocstate_t);
@@ -717,7 +721,8 @@ vuidmice_handle_wheel_resolution_ioctl(queue_t *qp, mblk_t *mp, int cmd)
err = EAGAIN;
break;
}
- *((int *)datap->b_wptr) = STATEP->vuid_mouse_mode;
+ *((int *)(void *)datap->b_wptr) =
+ STATEP->vuid_mouse_mode;
datap->b_wptr += sizeof (int);
mp->b_cont = datap;
break;
@@ -771,7 +776,7 @@ vuidmice_service_wheel_info(register mblk_t *datap)
wheel_info *wi;
int err = 0;
- wi = (wheel_info *)datap->b_rptr;
+ wi = (void *)datap->b_rptr;
if (wi->vers != VUID_WHEEL_INFO_VERS) {
err = EINVAL;
return (err);
@@ -796,7 +801,7 @@ vuidmice_service_wheel_state(register queue_t *qp,
wheel_state *ws;
uint_t err = 0;
- ws = (wheel_state *)datap->b_rptr;
+ ws = (void *)datap->b_rptr;
if (ws->vers != VUID_WHEEL_STATE_VERS) {
err = EINVAL;
return (err);
diff --git a/usr/src/uts/common/io/vuidmice/vuidps2.c b/usr/src/uts/common/io/vuidmice/vuidps2.c
index bd13b1d809..eb7787e93c 100644
--- a/usr/src/uts/common/io/vuidmice/vuidps2.c
+++ b/usr/src/uts/common/io/vuidmice/vuidps2.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -38,6 +37,7 @@
#include <sys/vuidmice.h>
#include <sys/vuid_wheel.h>
#include <sys/mouse.h>
+#include <sys/strsun.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
@@ -172,7 +172,7 @@ vuidmice_send_wheel_event(queue_t *const qp, uchar_t event_id,
return;
}
- fep = (Firm_event *)bp->b_wptr;
+ fep = (void *)bp->b_wptr;
fep->id = vuid_id_addr(vuid_first(VUID_WHEEL)) |
vuid_id_offset(event_id);
fep->pair_type = event_pair_type;
@@ -201,7 +201,7 @@ sendButtonEvent(queue_t *const qp)
if ((STATEP->buttons & mask) != (STATEP->oldbuttons & mask))
VUID_PUTNEXT(qp, (uchar_t)BUT(bmap[b]), FE_PAIR_NONE, 0,
- (STATEP->buttons & mask ? 1 : 0));
+ (STATEP->buttons & mask ? 1 : 0));
}
}
@@ -463,7 +463,7 @@ restart:
code &= 0xf;
if (STATEP->wheel_state_bf & (1 <<
- VUIDMICE_VERTICAL_WHEEL_ID)) {
+ VUIDMICE_VERTICAL_WHEEL_ID)) {
/*
* PS/2 mouse reports -ve values
* when the wheel is scrolled up. So
@@ -516,7 +516,7 @@ packet_complete:
* its not the start of the next packet, don't use
* this packet.
*/
- if ((mp->b_wptr - mp->b_rptr) > 0 &&
+ if (mp->b_wptr > mp->b_rptr &&
((mp->b_rptr[0] ^ STATEP->sync_byte) & 0x08)) {
/*
* bit 3 not set