Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp300/dev - make local functions static
details: https://anonhg.NetBSD.org/src/rev/b2641296eb07
branches: trunk
changeset: 761973:b2641296eb07
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Feb 12 16:40:29 2011 +0000
description:
- make local functions static
- some KNF
diffstat:
sys/arch/hp300/dev/diofb.c | 42 ++++---
sys/arch/hp300/dev/diofb_mono.c | 8 +-
sys/arch/hp300/dev/diofbreg.h | 58 +++++-----
sys/arch/hp300/dev/diofbvar.h | 12 +-
sys/arch/hp300/dev/dnkbd.c | 138 +++++++++++++-------------
sys/arch/hp300/dev/dvbox.c | 46 ++++----
sys/arch/hp300/dev/dvboxreg.h | 208 ++++++++++++++++++++--------------------
sys/arch/hp300/dev/gbox.c | 78 +++++++-------
sys/arch/hp300/dev/gboxreg.h | 72 ++++++------
sys/arch/hp300/dev/hyper.c | 20 +-
sys/arch/hp300/dev/hyperreg.h | 6 +-
sys/arch/hp300/dev/rbox.c | 46 ++++----
sys/arch/hp300/dev/rboxreg.h | 124 +++++++++++-----------
sys/arch/hp300/dev/topcat.c | 52 +++++-----
sys/arch/hp300/dev/topcatreg.h | 124 +++++++++++-----------
sys/arch/hp300/dev/tvrx.c | 20 +-
16 files changed, 527 insertions(+), 527 deletions(-)
diffs (truncated from 2014 to 300 lines):
diff -r 664c1fced1d4 -r b2641296eb07 sys/arch/hp300/dev/diofb.c
--- a/sys/arch/hp300/dev/diofb.c Sat Feb 12 16:37:32 2011 +0000
+++ b/sys/arch/hp300/dev/diofb.c Sat Feb 12 16:40:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: diofb.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */
+/* $NetBSD: diofb.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */
/* $OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $ */
/*
@@ -80,12 +80,12 @@
#include <hp300/dev/diofbreg.h>
#include <hp300/dev/diofbvar.h>
-void diofb_do_cursor(struct rasops_info *);
-void diofb_copycols(void *, int, int, int, int);
-void diofb_erasecols(void *, int, int, int, long);
-void diofb_copyrows(void *, int, int, int);
-void diofb_eraserows(void *, int, int, long);
-int diofb_allocattr(void *, int, int, int, long *);
+static void diofb_do_cursor(struct rasops_info *);
+static void diofb_copycols(void *, int, int, int, int);
+static void diofb_erasecols(void *, int, int, int, long);
+static void diofb_copyrows(void *, int, int, int);
+static void diofb_eraserows(void *, int, int, long);
+static int diofb_allocattr(void *, int, int, int, long *);
struct diofb diofb_cn;
@@ -130,7 +130,7 @@
*/
fb->fbkva = iomap(fb->fbaddr, fb->fbsize);
if (fb->fbkva == NULL)
- return (ENOMEM);
+ return ENOMEM;
}
if (fb->dwidth == 0 || fb->dheight == 0) {
fb->dwidth = (fbr->dwmsb << 8) | fbr->dwlsb;
@@ -153,7 +153,7 @@
fb->mapmode = WSDISPLAYIO_MODE_DUMBFB;
- return (0);
+ return 0;
}
/*
@@ -335,8 +335,9 @@
int
diofb_allocattr(void *cookie, int fg, int bg, int flg, long *attr)
{
+
if ((flg & (WSATTR_BLINK | WSATTR_HILIT)) != 0)
- return (EINVAL);
+ return EINVAL;
if ((flg & WSATTR_WSCOLORS) == 0) {
fg = WSCOL_WHITE;
@@ -460,14 +461,14 @@
struct rasops_info *ri = &fb->ri;
if (fb->nscreens > 0)
- return (ENOMEM);
+ return ENOMEM;
*cookiep = ri;
*curxp = *curyp = 0;
ri->ri_ops.allocattr(ri, 0, 0, 0, attrp);
fb->nscreens++;
- return (0);
+ return 0;
}
void
@@ -482,7 +483,8 @@
diofb_show_screen(void *v, void *cookie, int waitok,
void (*cb)(void *, int, int), void *cbarg)
{
- return (0);
+
+ return 0;
}
paddr_t
@@ -491,7 +493,7 @@
struct diofb *fb = v;
if ((offset & PAGE_MASK) != 0)
- return (-1);
+ return -1;
switch (fb->mapmode) {
case WSDISPLAYIO_MODE_MAPPED:
@@ -505,7 +507,7 @@
break;
}
- return (-1);
+ return -1;
}
int
@@ -516,14 +518,14 @@
int error;
if (index >= colcount || count > colcount - index)
- return (EINVAL);
+ return EINVAL;
if ((error = copyout(fb->cmap.r + index, cm->red, count)) != 0)
- return (error);
+ return error;
if ((error = copyout(fb->cmap.g + index, cm->green, count)) != 0)
- return (error);
+ return error;
if ((error = copyout(fb->cmap.b + index, cm->blue, count)) != 0)
- return (error);
+ return error;
- return (0);
+ return 0;
}
diff -r 664c1fced1d4 -r b2641296eb07 sys/arch/hp300/dev/diofb_mono.c
--- a/sys/arch/hp300/dev/diofb_mono.c Sat Feb 12 16:37:32 2011 +0000
+++ b/sys/arch/hp300/dev/diofb_mono.c Sat Feb 12 16:40:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: diofb_mono.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */
+/* $NetBSD: diofb_mono.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */
/* $OpenBSD: diofb_mono.c,v 1.3 2006/08/11 18:33:13 miod Exp $ */
/*
@@ -115,8 +115,8 @@
#include <hp300/dev/maskbits.h>
int
-diofb_mono_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy,
- u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop,
+diofb_mono_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy,
+ uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop,
int16_t planemask /* ignored */)
{
int width; /* add to get to same position in next line */
@@ -271,5 +271,5 @@
}
}
- return (0);
+ return 0;
}
diff -r 664c1fced1d4 -r b2641296eb07 sys/arch/hp300/dev/diofbreg.h
--- a/sys/arch/hp300/dev/diofbreg.h Sat Feb 12 16:37:32 2011 +0000
+++ b/sys/arch/hp300/dev/diofbreg.h Sat Feb 12 16:40:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: diofbreg.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $ */
+/* $NetBSD: diofbreg.h,v 1.3 2011/02/12 16:40:29 tsutsui Exp $ */
/* $OpenBSD: diofbreg.h,v 1.3 2007/01/07 15:13:52 miod Exp $ */
/*
@@ -63,33 +63,33 @@
#ifndef _LOCORE
struct diofbreg {
- u_int8_t :8;
- u_int8_t id; /* id and reset register 0x01 */
- u_int8_t sec_interrupt; /* secondary interrupt register 0x02 */
- u_int8_t interrupt; /* interrupt register 0x03 */
- u_int8_t :8;
- u_int8_t fbwmsb; /* frame buffer width MSB 0x05 */
- u_int8_t :8;
- u_int8_t fbwlsb; /* frame buffer height LSB 0x07 */
- u_int8_t :8;
- u_int8_t fbhmsb; /* frame buffer height MSB 0x09 */
- u_int8_t :8;
- u_int8_t fbhlsb; /* frame buffer height LSB 0x0b */
- u_int8_t :8;
- u_int8_t dwmsb; /* display width MSB 0x0d */
- u_int8_t :8;
- u_int8_t dwlsb; /* display width LSB 0x0f */
- u_int8_t :8;
- u_int8_t dhmsb; /* display height MSB 0x11 */
- u_int8_t :8;
- u_int8_t dhlsb; /* display height LSB 0x13 */
- u_int8_t :8;
- u_int8_t fbid; /* frame buffer id 0x15 */
- u_int8_t pad2[0x45];
- u_int8_t num_planes; /* number of color planes 0x5b */
- u_int8_t :8;
- u_int8_t fbomsb; /* frame buffer offset MSB 0x5d */
- u_int8_t :8;
- u_int8_t fbolsb; /* frame buffer offset LSB 0x5f */
+ uint8_t :8;
+ uint8_t id; /* id and reset register 0x01 */
+ uint8_t sec_interrupt; /* secondary interrupt register 0x02 */
+ uint8_t interrupt; /* interrupt register 0x03 */
+ uint8_t :8;
+ uint8_t fbwmsb; /* frame buffer width MSB 0x05 */
+ uint8_t :8;
+ uint8_t fbwlsb; /* frame buffer height LSB 0x07 */
+ uint8_t :8;
+ uint8_t fbhmsb; /* frame buffer height MSB 0x09 */
+ uint8_t :8;
+ uint8_t fbhlsb; /* frame buffer height LSB 0x0b */
+ uint8_t :8;
+ uint8_t dwmsb; /* display width MSB 0x0d */
+ uint8_t :8;
+ uint8_t dwlsb; /* display width LSB 0x0f */
+ uint8_t :8;
+ uint8_t dhmsb; /* display height MSB 0x11 */
+ uint8_t :8;
+ uint8_t dhlsb; /* display height LSB 0x13 */
+ uint8_t :8;
+ uint8_t fbid; /* frame buffer id 0x15 */
+ uint8_t pad2[0x45];
+ uint8_t num_planes; /* number of color planes 0x5b */
+ uint8_t :8;
+ uint8_t fbomsb; /* frame buffer offset MSB 0x5d */
+ uint8_t :8;
+ uint8_t fbolsb; /* frame buffer offset LSB 0x5f */
};
#endif
diff -r 664c1fced1d4 -r b2641296eb07 sys/arch/hp300/dev/diofbvar.h
--- a/sys/arch/hp300/dev/diofbvar.h Sat Feb 12 16:37:32 2011 +0000
+++ b/sys/arch/hp300/dev/diofbvar.h Sat Feb 12 16:40:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: diofbvar.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $ */
+/* $NetBSD: diofbvar.h,v 1.3 2011/02/12 16:40:29 tsutsui Exp $ */
/* $OpenBSD: diofbvar.h,v 1.10 2006/08/11 18:33:13 miod Exp $ */
/*
@@ -66,7 +66,7 @@
#ifdef _KERNEL
struct diocmap {
- u_int8_t r[256], g[256], b[256];
+ uint8_t r[256], g[256], b[256];
};
/*
@@ -103,8 +103,8 @@
u_int mapmode;
/* blockmove routine */
- int (*bmv)(struct diofb *, u_int16_t, u_int16_t, u_int16_t,
- u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t);
+ int (*bmv)(struct diofb *, uint16_t, uint16_t, uint16_t,
+ uint16_t, uint16_t, uint16_t, int16_t, int16_t);
};
/* Replacement Rules (rops) */
@@ -130,8 +130,8 @@
int diofb_show_screen(void *, void *, int, void (*)(void *, int, int),
void *);
-int diofb_mono_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t,
- u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t);
+int diofb_mono_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t,
+ uint16_t, uint16_t, uint16_t, int16_t, int16_t);
/* Console support */
int dvboxcnattach(bus_space_tag_t, bus_addr_t, int);
diff -r 664c1fced1d4 -r b2641296eb07 sys/arch/hp300/dev/dnkbd.c
--- a/sys/arch/hp300/dev/dnkbd.c Sat Feb 12 16:37:32 2011 +0000
+++ b/sys/arch/hp300/dev/dnkbd.c Sat Feb 12 16:40:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dnkbd.c,v 1.3 2011/02/12 16:37:32 tsutsui Exp $ */
+/* $NetBSD: dnkbd.c,v 1.4 2011/02/12 16:41:54 tsutsui Exp $ */
/* $OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $ */
/*
@@ -140,7 +140,7 @@
sc_state, sc_prevstate;
u_int sc_echolen;
- u_int8_t sc_mousepkt[3]; /* mouse packet being constructed */
+ uint8_t sc_mousepkt[3]; /* mouse packet being constructed */
u_int sc_mousepos; /* index in above */
struct callout sc_bellstop_tmo;
@@ -160,46 +160,46 @@
#endif
};
-int dnkbd_match(device_t, cfdata_t, void *);
-void dnkbd_attach(device_t, device_t, void *);
+static int dnkbd_match(device_t, cfdata_t, void *);
+static void dnkbd_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(dnkbd, sizeof(struct dnkbd_softc),
dnkbd_match, dnkbd_attach, NULL, NULL);
-void dnkbd_init(struct dnkbd_softc *, uint16_t, uint16_t);
-int dnkbd_enable(void *, int);
-void dnkbd_set_leds(void *, int);
-int dnkbd_ioctl(void *, u_long, void *, int, struct lwp *);
+static void dnkbd_init(struct dnkbd_softc *, uint16_t, uint16_t);
+static int dnkbd_enable(void *, int);
+static void dnkbd_set_leds(void *, int);
+static int dnkbd_ioctl(void *, u_long, void *, int, struct lwp *);
-const struct wskbd_accessops dnkbd_accessops = {
Home |
Main Index |
Thread Index |
Old Index