From 6bf6c91f5d69b0ae2bfe9db7f30d024a5a70e6b9 Mon Sep 17 00:00:00 2001 From: Yoshihiro Takahashi Date: Sun, 15 Oct 2000 04:54:17 +0000 Subject: [PATCH] Fixed warnings. --- sys/i386/isa/bs/bsfunc.c | 2 +- sys/i386/isa/bs/bshw_dma.c | 7 ++++--- sys/i386/isa/bs/bshw_pdma.c | 5 +++-- sys/i386/isa/bs/bsif.h | 2 ++ sys/i386/isa/ccbque.h | 1 - sys/pc98/cbus/30line.h | 10 +++++++++- sys/pc98/cbus/clock.c | 2 ++ sys/pc98/cbus/fdc.c | 10 ++++++++++ sys/pc98/cbus/gdc.c | 29 ++++++++--------------------- sys/pc98/cbus/pcrtc.c | 2 ++ sys/pc98/pc98/30line.h | 10 +++++++++- sys/pc98/pc98/clock.c | 2 ++ sys/pc98/pc98/fd.c | 10 ++++++++++ sys/pc98/pc98/pc98gdc.c | 29 ++++++++--------------------- 14 files changed, 70 insertions(+), 51 deletions(-) diff --git a/sys/i386/isa/bs/bsfunc.c b/sys/i386/isa/bs/bsfunc.c index d4fc51c76dc..42a636fab10 100644 --- a/sys/i386/isa/bs/bsfunc.c +++ b/sys/i386/isa/bs/bsfunc.c @@ -631,7 +631,7 @@ bs_check_target(ti) /* inquiry */ bzero(&scsi_cmd, sizeof(scsi_cmd)); scsi_cmd.opcode = INQUIRY; - scsi_cmd.length = sizeof(struct scsi_inquiry_data); + scsi_cmd.length = (u_int8_t) sizeof(struct scsi_inquiry_data); cb = bs_make_internal_ccb(ti, 0, (u_int8_t *) &scsi_cmd, sizeof(scsi_cmd), (u_int8_t *) &scsi_inquiry_data, diff --git a/sys/i386/isa/bs/bshw_dma.c b/sys/i386/isa/bs/bshw_dma.c index 5b32de74049..74cc3ee1e6f 100644 --- a/sys/i386/isa/bs/bshw_dma.c +++ b/sys/i386/isa/bs/bshw_dma.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $NecBSD: bshw_dma.c,v 1.3 1997/07/26 06:03:16 honda Exp $ */ /* $NetBSD$ */ /* @@ -35,7 +36,7 @@ /********************************************************* * static declare. *********************************************************/ -static BS_INLINE void bshw_dmastart __P((struct bs_softc *)); +static void bshw_dmastart __P((struct bs_softc *)); static void bshw_dmadone __P((struct bs_softc *)); /********************************************** @@ -172,7 +173,7 @@ bs_dma_xfer_end(ti) /********************************************** * GENERIC DMA FUNCS **********************************************/ -static short dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; +static u_int8_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; /* common dma settings */ #undef DMA1_SMSK @@ -186,7 +187,7 @@ static short dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; #undef DMA1_CHN #define DMA1_CHN(c) (0x01 + ((c) << 2)) -static BS_INLINE void +static void bshw_dmastart(bsc) struct bs_softc *bsc; { diff --git a/sys/i386/isa/bs/bshw_pdma.c b/sys/i386/isa/bs/bshw_pdma.c index 3443afbd428..a4e4cb71100 100644 --- a/sys/i386/isa/bs/bshw_pdma.c +++ b/sys/i386/isa/bs/bshw_pdma.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $NecBSD: bshw_pdma.c,v 1.4 1997/10/31 17:43:39 honda Exp $ */ /* $NetBSD$ */ /* @@ -36,7 +37,7 @@ static BS_INLINE void bshw_lc_smit_start __P((struct bs_softc *, int, u_int)); static int bshw_lc_smit_fstat __P((struct bs_softc *, int, int)); -static BS_INLINE void bshw_lc_smit_stop __P((struct bs_softc *)); +static void bshw_lc_smit_stop __P((struct bs_softc *)); /********************************************************* * SM FIFO (GENERIC) @@ -115,7 +116,7 @@ bad: #define LC_SFSZ 0x0c #define LC_REST (LC_FSZ - LC_SFSZ) -static BS_INLINE void +static void bshw_lc_smit_stop(bsc) struct bs_softc *bsc; { diff --git a/sys/i386/isa/bs/bsif.h b/sys/i386/isa/bs/bsif.h index 6ac4cba52fe..ed6317518c0 100644 --- a/sys/i386/isa/bs/bsif.h +++ b/sys/i386/isa/bs/bsif.h @@ -105,7 +105,9 @@ #endif /* __NetBSD__ */ #ifdef __FreeBSD__ +#include #include +#include #include #include #include diff --git a/sys/i386/isa/ccbque.h b/sys/i386/isa/ccbque.h index cb6bebead39..eabcc378ab5 100644 --- a/sys/i386/isa/ccbque.h +++ b/sys/i386/isa/ccbque.h @@ -75,7 +75,6 @@ DEV##_get_ccb() \ register struct CCBTYPE *cb; \ int s = splcam(); \ \ -again: \ if (CCBTYPE##que.count < CCBTYPE##que.maxccb) \ { \ CCBTYPE##que.count ++; \ diff --git a/sys/pc98/cbus/30line.h b/sys/pc98/cbus/30line.h index 15b7295672f..c62ec41733c 100644 --- a/sys/pc98/cbus/30line.h +++ b/sys/pc98/cbus/30line.h @@ -94,21 +94,28 @@ static void master_gdc_cmd(unsigned int); static void master_gdc_prm(unsigned int); static void master_gdc_word_prm(unsigned int); +#ifdef LINE30 static void master_gdc_fifo_empty(void); +#endif static void master_gdc_wait_vsync(void); static void gdc_cmd(unsigned int); +#ifdef LINE30 static void gdc_prm(unsigned int); static void gdc_word_prm(unsigned int); static void gdc_fifo_empty(void); +#endif static void gdc_wait_vsync(void); +#ifdef LINE30 static int check_gdc_clock(void); static int gdc_INFO = _25L; +#endif static int gdc_FH = _24KHZ; static void initialize_gdc(unsigned int, int); +#ifdef LINE30 static unsigned int master_param[2][2][8] = { {{78, 8, 7, 9, 7, 7, 25, 400}, /* 400/24k */ {_CR-2, _VS, _HS-1, _HFP-1, _HBP-1, _VFP, _VBP, _LF}}, /* 480/24k */ @@ -135,5 +142,6 @@ static unsigned int slave_param[2][6][8] = { static int SlavePCH[2] = {40,80}; static int MasterPCH = 80; static int SlaveScrlLF[3] = {400,400,_LF}; - #endif + +#endif /* __PC98_PC98_30LINE_H__ */ diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 88ec7063aee..90a31e6a4e2 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -1129,6 +1129,8 @@ inittodr(time_t base) second); /* sec now contains the number of seconds, since Jan 1 1970, in the local time zone */ + + s = splhigh(); #else /* IBM-PC */ /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index a21cb8a7866..c72c41e77fc 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -865,7 +865,11 @@ fdc_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) static int fdc_probe(device_t dev) { +#ifdef PC98 + int error; +#else int error, ic_type; +#endif struct fdc_data *fdc; fdc = device_get_softc(dev); @@ -1157,12 +1161,18 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); static int fd_probe(device_t dev) { +#ifdef PC98 + u_int fdt; +#else int i; u_int fdt, st0, st3; +#endif struct fd_data *fd; struct fdc_data *fdc; fdsu_t fdsu; +#ifndef PC98 static int fd_fifo = 0; +#endif fdsu = *(int *)device_get_ivars(dev); /* xxx cheat a bit... */ fd = device_get_softc(dev); diff --git a/sys/pc98/cbus/gdc.c b/sys/pc98/cbus/gdc.c index 4543e0fa286..3dad2bc4e65 100644 --- a/sys/pc98/cbus/gdc.c +++ b/sys/pc98/cbus/gdc.c @@ -37,10 +37,11 @@ #include #include +#include + #include #include -#include #include #include @@ -287,7 +288,6 @@ static video_adapter_t biosadapter[1]; /* video driver declarations */ static int gdc_configure(int flags); -static int gdc_nop(void); static int gdc_err(video_adapter_t *adp, ...); static vi_probe_t gdc_probe; static vi_init_t gdc_init; @@ -377,7 +377,6 @@ static int gdc_init_done = FALSE; /* local functions */ static int map_gen_mode_num(int type, int color, int mode); static int probe_adapters(void); -static void dump_buffer(u_char *buf, size_t len); #define prologue(adp, flag, err) \ if (!gdc_init_done || !((adp)->va_flags & (flag))) \ @@ -515,10 +514,12 @@ static void master_gdc_word_prm(unsigned int wpmtr) master_gdc_prm((wpmtr >> 8) & 0x00ff); } +#ifdef LINE30 static void master_gdc_fifo_empty(void) { while ( (inb(IO_GDC1) & 4) == 0); } +#endif static void master_gdc_wait_vsync(void) { @@ -532,6 +533,7 @@ static void gdc_cmd(unsigned int cmd) outb( IO_GDC2+2, cmd); } +#ifdef LINE30 static void gdc_prm(unsigned int pmtr) { while ( (inb(IO_GDC2) & 2) != 0); @@ -548,6 +550,7 @@ static void gdc_fifo_empty(void) { while ( (inb(IO_GDC2) & 0x04) == 0); } +#endif static void gdc_wait_vsync(void) { @@ -555,6 +558,7 @@ static void gdc_wait_vsync(void) while ( (inb(IO_GDC2) & 0x20) == 0); } +#ifdef LINE30 static int check_gdc_clock(void) { if ((inb(IO_SYSPORT) & 0x80) == 0){ @@ -563,6 +567,7 @@ static int check_gdc_clock(void) return _2_5MHZ; } } +#endif static void initialize_gdc(unsigned int mode, int isGraph) { @@ -767,12 +772,6 @@ gdc_set_origin(video_adapter_t *adp, off_t offset) return 0; } -static int -gdc_nop(void) -{ - return 0; -} - /* entry points */ static int @@ -1244,18 +1243,6 @@ gdc_dev_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) } } -static void -dump_buffer(u_char *buf, size_t len) -{ - int i; - - for(i = 0; i < len;) { - printf("%02x ", buf[i]); - if ((++i % 16) == 0) - printf("\n"); - } -} - /* * diag(): * Print some information about the video adapter and video modes, diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 88ec7063aee..90a31e6a4e2 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -1129,6 +1129,8 @@ inittodr(time_t base) second); /* sec now contains the number of seconds, since Jan 1 1970, in the local time zone */ + + s = splhigh(); #else /* IBM-PC */ /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) diff --git a/sys/pc98/pc98/30line.h b/sys/pc98/pc98/30line.h index 15b7295672f..c62ec41733c 100644 --- a/sys/pc98/pc98/30line.h +++ b/sys/pc98/pc98/30line.h @@ -94,21 +94,28 @@ static void master_gdc_cmd(unsigned int); static void master_gdc_prm(unsigned int); static void master_gdc_word_prm(unsigned int); +#ifdef LINE30 static void master_gdc_fifo_empty(void); +#endif static void master_gdc_wait_vsync(void); static void gdc_cmd(unsigned int); +#ifdef LINE30 static void gdc_prm(unsigned int); static void gdc_word_prm(unsigned int); static void gdc_fifo_empty(void); +#endif static void gdc_wait_vsync(void); +#ifdef LINE30 static int check_gdc_clock(void); static int gdc_INFO = _25L; +#endif static int gdc_FH = _24KHZ; static void initialize_gdc(unsigned int, int); +#ifdef LINE30 static unsigned int master_param[2][2][8] = { {{78, 8, 7, 9, 7, 7, 25, 400}, /* 400/24k */ {_CR-2, _VS, _HS-1, _HFP-1, _HBP-1, _VFP, _VBP, _LF}}, /* 480/24k */ @@ -135,5 +142,6 @@ static unsigned int slave_param[2][6][8] = { static int SlavePCH[2] = {40,80}; static int MasterPCH = 80; static int SlaveScrlLF[3] = {400,400,_LF}; - #endif + +#endif /* __PC98_PC98_30LINE_H__ */ diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index 88ec7063aee..90a31e6a4e2 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -1129,6 +1129,8 @@ inittodr(time_t base) second); /* sec now contains the number of seconds, since Jan 1 1970, in the local time zone */ + + s = splhigh(); #else /* IBM-PC */ /* Look if we have a RTC present and the time is valid */ if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index a21cb8a7866..c72c41e77fc 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -865,7 +865,11 @@ fdc_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) static int fdc_probe(device_t dev) { +#ifdef PC98 + int error; +#else int error, ic_type; +#endif struct fdc_data *fdc; fdc = device_get_softc(dev); @@ -1157,12 +1161,18 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); static int fd_probe(device_t dev) { +#ifdef PC98 + u_int fdt; +#else int i; u_int fdt, st0, st3; +#endif struct fd_data *fd; struct fdc_data *fdc; fdsu_t fdsu; +#ifndef PC98 static int fd_fifo = 0; +#endif fdsu = *(int *)device_get_ivars(dev); /* xxx cheat a bit... */ fd = device_get_softc(dev); diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c index 4543e0fa286..3dad2bc4e65 100644 --- a/sys/pc98/pc98/pc98gdc.c +++ b/sys/pc98/pc98/pc98gdc.c @@ -37,10 +37,11 @@ #include #include +#include + #include #include -#include #include #include @@ -287,7 +288,6 @@ static video_adapter_t biosadapter[1]; /* video driver declarations */ static int gdc_configure(int flags); -static int gdc_nop(void); static int gdc_err(video_adapter_t *adp, ...); static vi_probe_t gdc_probe; static vi_init_t gdc_init; @@ -377,7 +377,6 @@ static int gdc_init_done = FALSE; /* local functions */ static int map_gen_mode_num(int type, int color, int mode); static int probe_adapters(void); -static void dump_buffer(u_char *buf, size_t len); #define prologue(adp, flag, err) \ if (!gdc_init_done || !((adp)->va_flags & (flag))) \ @@ -515,10 +514,12 @@ static void master_gdc_word_prm(unsigned int wpmtr) master_gdc_prm((wpmtr >> 8) & 0x00ff); } +#ifdef LINE30 static void master_gdc_fifo_empty(void) { while ( (inb(IO_GDC1) & 4) == 0); } +#endif static void master_gdc_wait_vsync(void) { @@ -532,6 +533,7 @@ static void gdc_cmd(unsigned int cmd) outb( IO_GDC2+2, cmd); } +#ifdef LINE30 static void gdc_prm(unsigned int pmtr) { while ( (inb(IO_GDC2) & 2) != 0); @@ -548,6 +550,7 @@ static void gdc_fifo_empty(void) { while ( (inb(IO_GDC2) & 0x04) == 0); } +#endif static void gdc_wait_vsync(void) { @@ -555,6 +558,7 @@ static void gdc_wait_vsync(void) while ( (inb(IO_GDC2) & 0x20) == 0); } +#ifdef LINE30 static int check_gdc_clock(void) { if ((inb(IO_SYSPORT) & 0x80) == 0){ @@ -563,6 +567,7 @@ static int check_gdc_clock(void) return _2_5MHZ; } } +#endif static void initialize_gdc(unsigned int mode, int isGraph) { @@ -767,12 +772,6 @@ gdc_set_origin(video_adapter_t *adp, off_t offset) return 0; } -static int -gdc_nop(void) -{ - return 0; -} - /* entry points */ static int @@ -1244,18 +1243,6 @@ gdc_dev_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg) } } -static void -dump_buffer(u_char *buf, size_t len) -{ - int i; - - for(i = 0; i < len;) { - printf("%02x ", buf[i]); - if ((++i % 16) == 0) - printf("\n"); - } -} - /* * diag(): * Print some information about the video adapter and video modes,