summaryrefslogtreecommitdiff
path: root/sys/dev/adb
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-13 20:56:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-13 20:56:57 +0000
commit2a3b7a961006abcdd282b1ad9905c894b46ef80a (patch)
tree696f37ac1fc60b50d1bd51baf809c6549548250a /sys/dev/adb
parent647887e8a26c8ad8d866cd079da8526f70969893 (diff)
Drop the second and third arguments to adb_op_sync, for they are not used;
while there, remove explicit global variable initializations to zero, and appease the gods by removing the most ludicrous spurious casts. No functional change (except for code shrinkage).
Diffstat (limited to 'sys/dev/adb')
-rw-r--r--sys/dev/adb/adb.h4
-rw-r--r--sys/dev/adb/akbd.c12
-rw-r--r--sys/dev/adb/ams.c34
3 files changed, 25 insertions, 25 deletions
diff --git a/sys/dev/adb/adb.h b/sys/dev/adb/adb.h
index e675281628f..209688337b6 100644
--- a/sys/dev/adb/adb.h
+++ b/sys/dev/adb/adb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.h,v 1.2 2006/02/12 18:06:23 miod Exp $ */
+/* $OpenBSD: adb.h,v 1.3 2007/03/13 20:56:56 miod Exp $ */
/* $NetBSD: adbsys.h,v 1.4 2000/12/19 02:59:24 tsubai Exp $ */
/*-
@@ -139,7 +139,7 @@ typedef struct {
} ADBDataBlock;
int adbprint(void *, const char *);
-int adb_op_sync(Ptr, Ptr, Ptr, short);
+int adb_op_sync(Ptr, short);
int set_adb_info(ADBSetInfoBlock *, int);
#endif /* _KERNEL */
diff --git a/sys/dev/adb/akbd.c b/sys/dev/adb/akbd.c
index a685b775d90..938a9b25a1e 100644
--- a/sys/dev/adb/akbd.c
+++ b/sys/dev/adb/akbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: akbd.c,v 1.5 2006/03/23 21:54:26 miod Exp $ */
+/* $OpenBSD: akbd.c,v 1.6 2007/03/13 20:56:56 miod Exp $ */
/* $NetBSD: akbd.c,v 1.17 2005/01/15 16:00:59 chs Exp $ */
/*
@@ -144,7 +144,7 @@ akbdattach(struct device *parent, struct device *self, void *aux)
case ADB_EXTKBD:
cmd = ADBTALK(sc->adbaddr, 1);
kbd_done =
- (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) == 0);
+ (adb_op_sync((Ptr)buffer, cmd) == 0);
/* Ignore Logitech MouseMan/Trackman pseudo keyboard */
if (kbd_done && buffer[1] == 0x9a && buffer[2] == 0x20) {
@@ -305,7 +305,7 @@ getleds(int addr)
buffer[0] = 0;
cmd = ADBTALK(addr, 2);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) == 0 &&
+ if (adb_op_sync((Ptr)buffer, cmd) == 0 &&
buffer[0] > 0)
leds = ~(buffer[2]) & 0x07;
@@ -329,7 +329,7 @@ setleds(struct akbd_softc *sc, u_char leds)
buffer[0] = 0;
cmd = ADBTALK(addr, 2);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) || buffer[0] == 0)
+ if (adb_op_sync((Ptr)buffer, cmd) || buffer[0] == 0)
return (EIO);
leds = ~leds & 0x07;
@@ -337,11 +337,11 @@ setleds(struct akbd_softc *sc, u_char leds)
buffer[2] |= leds;
cmd = ADBLISTEN(addr, 2);
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
/* talk R2 */
cmd = ADBTALK(addr, 2);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) || buffer[0] == 0)
+ if (adb_op_sync((Ptr)buffer, cmd) || buffer[0] == 0)
return (EIO);
if ((buffer[2] & 0xf8) != leds)
diff --git a/sys/dev/adb/ams.c b/sys/dev/adb/ams.c
index a85db149ac5..d1fd1925aa3 100644
--- a/sys/dev/adb/ams.c
+++ b/sys/dev/adb/ams.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ams.c,v 1.3 2006/02/12 18:06:24 miod Exp $ */
+/* $OpenBSD: ams.c,v 1.4 2007/03/13 20:56:56 miod Exp $ */
/* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */
/*
@@ -235,7 +235,7 @@ ems_init(struct ams_softc *sc)
buffer[4] = 0x07; /* Locking mask = 0000b,
* enable buttons = 0111b
*/
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
sc->sc_buttons = 3;
sc->sc_res = 200;
@@ -249,21 +249,21 @@ ems_init(struct ams_softc *sc)
{ 8, 0xa5, 0x14, 0, 0, 0x69, 0xff, 0xff, 0x27 };
buffer[0] = 0;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, ADBFLUSH(adbaddr));
+ adb_op_sync((Ptr)buffer, ADBFLUSH(adbaddr));
- adb_op_sync((Ptr)data1, (Ptr)0, (Ptr)0, ADBLISTEN(adbaddr, 2));
+ adb_op_sync((Ptr)data1, ADBLISTEN(adbaddr, 2));
buffer[0] = 0;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, ADBFLUSH(adbaddr));
+ adb_op_sync((Ptr)buffer, ADBFLUSH(adbaddr));
- adb_op_sync((Ptr)data2, (Ptr)0, (Ptr)0, ADBLISTEN(adbaddr, 2));
+ adb_op_sync((Ptr)data2, ADBLISTEN(adbaddr, 2));
return;
}
if ((sc->handler_id == ADBMS_100DPI) ||
(sc->handler_id == ADBMS_200DPI)) {
/* found a mouse */
cmd = ADBTALK(adbaddr, 3);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd)) {
+ if (adb_op_sync((Ptr)buffer, cmd)) {
#ifdef ADB_DEBUG
if (adb_debug)
printf("adb: ems_init timed out\n");
@@ -274,7 +274,7 @@ ems_init(struct ams_softc *sc)
/* Attempt to initialize Extended Mouse Protocol */
buffer[2] = 4; /* make handler ID 4 */
cmd = ADBLISTEN(adbaddr, 3);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd)) {
+ if (adb_op_sync((Ptr)buffer, cmd)) {
#ifdef ADB_DEBUG
if (adb_debug)
printf("adb: ems_init timed out\n");
@@ -287,11 +287,11 @@ ems_init(struct ams_softc *sc)
* try to initialize it as other types
*/
cmd = ADBTALK(adbaddr, 3);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) == 0 &&
+ if (adb_op_sync((Ptr)buffer, cmd) == 0 &&
buffer[2] == ADBMS_EXTENDED) {
sc->handler_id = ADBMS_EXTENDED;
cmd = ADBTALK(adbaddr, 1);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd)) {
+ if (adb_op_sync((Ptr)buffer, cmd)) {
#ifdef ADB_DEBUG
if (adb_debug)
printf("adb: ems_init timed out\n");
@@ -313,25 +313,25 @@ ems_init(struct ams_softc *sc)
buffer[0]=2;
buffer[1]=0x00;
buffer[2]=0x81;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
cmd = ADBLISTEN(adbaddr, 1);
buffer[0]=2;
buffer[1]=0x01;
buffer[2]=0x81;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
cmd = ADBLISTEN(adbaddr, 1);
buffer[0]=2;
buffer[1]=0x02;
buffer[2]=0x81;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
cmd = ADBLISTEN(adbaddr, 1);
buffer[0]=2;
buffer[1]=0x03;
buffer[2]=0x38;
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
sc->sc_buttons = 3;
sc->sc_res = 400;
@@ -345,7 +345,7 @@ ems_init(struct ams_softc *sc)
/* Attempt to initialize as an A3 mouse */
buffer[2] = 0x03; /* make handler ID 3 */
cmd = ADBLISTEN(adbaddr, 3);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd)) {
+ if (adb_op_sync((Ptr)buffer, cmd)) {
#ifdef ADB_DEBUG
if (adb_debug)
printf("adb: ems_init timed out\n");
@@ -358,7 +358,7 @@ ems_init(struct ams_softc *sc)
* try to initialize it as other types
*/
cmd = ADBTALK(adbaddr, 3);
- if (adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd) == 0
+ if (adb_op_sync((Ptr)buffer, cmd) == 0
&& buffer[2] == ADBMS_MSA3) {
sc->handler_id = ADBMS_MSA3;
/* Initialize as above */
@@ -372,7 +372,7 @@ ems_init(struct ams_softc *sc)
* enable 3 button mode = 0111b,
* speed = normal
*/
- adb_op_sync((Ptr)buffer, (Ptr)0, (Ptr)0, cmd);
+ adb_op_sync((Ptr)buffer, cmd);
sc->sc_buttons = 3;
sc->sc_res = 300;
} else {