diff options
| author | he <he@NetBSD.org> | 2005-06-04 14:42:36 +0000 |
|---|---|---|
| committer | he <he@NetBSD.org> | 2005-06-04 14:42:36 +0000 |
| commit | 5cc5caddf2f0d92f0cd12da3f28f811ad6b56fb9 (patch) | |
| tree | d6d0f4647d30cf77ed16aace37b767add3603c28 /sys/arch/atari/dev | |
| parent | 5cfd2bfc98c8df2d4000ed6fc010915cc93aecda (diff) | |
Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
Diffstat (limited to 'sys/arch/atari/dev')
| -rw-r--r-- | sys/arch/atari/dev/atari5380.c | 8 | ||||
| -rw-r--r-- | sys/arch/atari/dev/clock.c | 16 | ||||
| -rw-r--r-- | sys/arch/atari/dev/fd.c | 6 | ||||
| -rw-r--r-- | sys/arch/atari/dev/grfabs_reg.h | 4 | ||||
| -rw-r--r-- | sys/arch/atari/dev/hdfd.c | 13 | ||||
| -rw-r--r-- | sys/arch/atari/dev/ite.c | 38 | ||||
| -rw-r--r-- | sys/arch/atari/dev/ncr5380.c | 18 | ||||
| -rw-r--r-- | sys/arch/atari/dev/ncr5380reg.h | 8 | ||||
| -rw-r--r-- | sys/arch/atari/dev/ncr5380var.h | 4 | ||||
| -rw-r--r-- | sys/arch/atari/dev/zs.c | 8 |
10 files changed, 62 insertions, 61 deletions
diff --git a/sys/arch/atari/dev/atari5380.c b/sys/arch/atari/dev/atari5380.c index d9b0c292a64..36109351a3f 100644 --- a/sys/arch/atari/dev/atari5380.c +++ b/sys/arch/atari/dev/atari5380.c @@ -1,4 +1,4 @@ -/* $NetBSD: atari5380.c,v 1.36 2003/07/15 01:19:47 lukem Exp $ */ +/* $NetBSD: atari5380.c,v 1.37 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atari5380.c,v 1.36 2003/07/15 01:19:47 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atari5380.c,v 1.37 2005/06/04 14:42:36 he Exp $"); #include "opt_atariscsi.h" @@ -138,14 +138,14 @@ struct scsi_dma { #define set_scsi_dma(addr, val) (void)( \ { \ - u_char *address = (u_char*)addr+1; \ + u_char *address = (u_char*)__UNVOLATILE(addr+1); \ u_long nval = (u_long)val; \ __asm("movepl %0, %1@(0)": :"d" (nval), "a" (address)); \ }) #define get_scsi_dma(addr, res) ( \ { \ - u_char *address = (u_char*)addr+1; \ + u_char *address = (u_char*)__UNVOLATILE(addr+1); \ u_long nval; \ __asm("movepl %1@(0), %0": "=d" (nval) : "a" (address)); \ res = (u_long)nval; \ diff --git a/sys/arch/atari/dev/clock.c b/sys/arch/atari/dev/clock.c index bf2ab702168..7d3fb489c29 100644 --- a/sys/arch/atari/dev/clock.c +++ b/sys/arch/atari/dev/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.34 2003/08/07 16:26:58 agc Exp $ */ +/* $NetBSD: clock.c,v 1.35 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.34 2003/08/07 16:26:58 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.35 2005/06/04 14:42:36 he Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -336,7 +336,7 @@ void delay(n) int n; { - int tick, otick; + int ticks, otick; /* * Read the counter first, so that the rest of the setup overhead is @@ -362,11 +362,11 @@ int n; } while(n > 0) { - tick = MFP->mf_tbdr; - if(tick > otick) - n -= TIMB_LIMIT - (tick - otick); - else n -= otick - tick; - otick = tick; + ticks = MFP->mf_tbdr; + if(ticks > otick) + n -= TIMB_LIMIT - (ticks - otick); + else n -= otick - ticks; + otick = ticks; } } diff --git a/sys/arch/atari/dev/fd.c b/sys/arch/atari/dev/fd.c index 4d9c212bc48..582d80ca38b 100644 --- a/sys/arch/atari/dev/fd.c +++ b/sys/arch/atari/dev/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.49 2004/10/28 07:07:36 yamt Exp $ */ +/* $NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.49 2004/10/28 07:07:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -128,7 +128,7 @@ static short nopens = 0; /* Number of opens executed */ static short fd_state = FLP_IDLE; /* Current driver state */ static int lock_stat= 0; /* DMA locking status */ static short fd_cmd = 0; /* command being executed */ -static char *fd_error= NULL; /* error from fd_xfer_ok() */ +static const char *fd_error= NULL; /* error from fd_xfer_ok() */ /* * Private per device data diff --git a/sys/arch/atari/dev/grfabs_reg.h b/sys/arch/atari/dev/grfabs_reg.h index f86d1fb0f44..5d2980fbbe7 100644 --- a/sys/arch/atari/dev/grfabs_reg.h +++ b/sys/arch/atari/dev/grfabs_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: grfabs_reg.h,v 1.11 1998/12/20 14:32:53 thomas Exp $ */ +/* $NetBSD: grfabs_reg.h,v 1.12 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -153,7 +153,7 @@ struct grfabs_sw { /* display mode */ struct display_mode { LIST_ENTRY(display_mode) link; - u_char *name; /* logical name for mode. */ + const u_char *name; /* logical name for mode. */ dimen_t size; /* screen size */ u_char depth; /* screen depth */ void *data; /* opaque driver data */ diff --git a/sys/arch/atari/dev/hdfd.c b/sys/arch/atari/dev/hdfd.c index a4bcbf94d7c..108ad69ddc8 100644 --- a/sys/arch/atari/dev/hdfd.c +++ b/sys/arch/atari/dev/hdfd.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdfd.c,v 1.44 2004/10/28 07:07:36 yamt Exp $ */ +/* $NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $ */ /*- * Copyright (c) 1996 Leo Weppelman @@ -91,7 +91,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.44 2004/10/28 07:07:36 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $"); #include "opt_ddb.h" @@ -228,7 +228,7 @@ struct fd_type { int rate; /* transfer speed code */ u_char fillbyte; /* format fill byte */ u_char interleave; /* interleave factor (formatting) */ - char *name; + const char *name; }; /* @@ -307,7 +307,7 @@ int fdcresult __P((struct fdc_softc *fdc)); int out_fdc __P((u_char x)); void fdc_ctrl_intr __P((struct clockframe)); void fdcstart __P((struct fdc_softc *fdc)); -void fdcstatus __P((struct device *dv, int n, char *s)); +void fdcstatus __P((struct device *dv, int n, const char *s)); void fdctimeout __P((void *arg)); void fdcpseudointr __P((void *arg)); int fdcintr __P((void *)); @@ -366,7 +366,8 @@ fdcprobe(parent, cfp, aux) out: if (fdc_matched == 0) { - bus_space_unmap(mb_tag, (caddr_t)fdio_addr, FD_IOSIZE); + bus_space_unmap(mb_tag, (caddr_t)__UNVOLATILE(fdio_addr), + FD_IOSIZE); mb_free_bus_space_tag(mb_tag); } @@ -893,7 +894,7 @@ void fdcstatus(dv, n, s) struct device *dv; int n; - char *s; + const char *s; { struct fdc_softc *fdc = (void *)dv->dv_parent; char bits[64]; diff --git a/sys/arch/atari/dev/ite.c b/sys/arch/atari/dev/ite.c index a8556e1fd26..345b30261db 100644 --- a/sys/arch/atari/dev/ite.c +++ b/sys/arch/atari/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.45 2005/03/02 08:14:26 chs Exp $ */ +/* $NetBSD: ite.c,v 1.46 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -81,7 +81,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.45 2005/03/02 08:14:26 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.46 2005/06/04 14:42:36 he Exp $"); #include "opt_ddb.h" @@ -158,7 +158,7 @@ static __inline__ void ite_inline __P((struct ite_softc *, int)); static __inline__ void ite_lf __P((struct ite_softc *)); static __inline__ void ite_dnline __P((struct ite_softc *, int)); static __inline__ void ite_rlf __P((struct ite_softc *)); -static __inline__ void ite_sendstr __P((char *)); +static __inline__ void ite_sendstr __P((const char *)); static __inline__ void snap_cury __P((struct ite_softc *)); static void alignment_display __P((struct ite_softc *)); @@ -1144,7 +1144,7 @@ enum caller caller; /* helper functions, makes the code below more readable */ static __inline__ void ite_sendstr(str) - char *str; + const char *str; { struct tty *kbd_tty; @@ -2052,72 +2052,72 @@ iteputchar(c, ip) case 'm': /* big attribute setter/resetter */ { - char *cp; + char *chp; *ip->ap = 0; /* kludge to make CSIm work (== CSI0m) */ if (ip->ap == ip->argbuf) ip->ap++; - for (cp = ip->argbuf; cp < ip->ap; ) + for (chp = ip->argbuf; chp < ip->ap; ) { - switch (*cp) + switch (*chp) { case 0: case '0': clr_attr (ip, ATTR_ALL); - cp++; + chp++; break; case '1': set_attr (ip, ATTR_BOLD); - cp++; + chp++; break; case '2': - switch (cp[1]) + switch (chp[1]) { case '2': clr_attr (ip, ATTR_BOLD); - cp += 2; + chp += 2; break; case '4': clr_attr (ip, ATTR_UL); - cp += 2; + chp += 2; break; case '5': clr_attr (ip, ATTR_BLINK); - cp += 2; + chp += 2; break; case '7': clr_attr (ip, ATTR_INV); - cp += 2; + chp += 2; break; default: - cp++; + chp++; break; } break; case '4': set_attr (ip, ATTR_UL); - cp++; + chp++; break; case '5': set_attr (ip, ATTR_BLINK); - cp++; + chp++; break; case '7': set_attr (ip, ATTR_INV); - cp++; + chp++; break; default: - cp++; + chp++; break; } } diff --git a/sys/arch/atari/dev/ncr5380.c b/sys/arch/atari/dev/ncr5380.c index 8872f193c59..2c0c8737d72 100644 --- a/sys/arch/atari/dev/ncr5380.c +++ b/sys/arch/atari/dev/ncr5380.c @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380.c,v 1.48 2005/02/21 00:29:06 thorpej Exp $ */ +/* $NetBSD: ncr5380.c,v 1.49 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.48 2005/02/21 00:29:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.49 2005/06/04 14:42:36 he Exp $"); /* * Bit mask of targets you want debugging to be shown @@ -922,10 +922,10 @@ int code; */ if (!reach_msg_out(sc, sizeof(struct scsipi_generic))) { u_long len = 1; - u_char phase = PH_MSGOUT; + u_char phse = PH_MSGOUT; u_char msg = MSG_ABORT; - transfer_pio(&phase, &msg, &len, 0); + transfer_pio(&phse, &msg, &len, 0); } else scsi_reset_verbose(sc, "Connected to unidentified target"); @@ -1938,7 +1938,7 @@ struct ncr_softc *sc; * Prefix message with full target info. */ static void -ncr_tprint(SC_REQ *reqp, char *fmt, ...) +ncr_tprint(SC_REQ *reqp, const char *fmt, ...) { va_list ap; @@ -1952,7 +1952,7 @@ ncr_tprint(SC_REQ *reqp, char *fmt, ...) * Prefix message with adapter info. */ static void -ncr_aprint(struct ncr_softc *sc, char *fmt, ...) +ncr_aprint(struct ncr_softc *sc, const char *fmt, ...) { va_list ap; char buf[256]; @@ -1966,7 +1966,7 @@ ncr_aprint(struct ncr_softc *sc, char *fmt, ...) /**************************************************************************** * Start Debugging Functions * ****************************************************************************/ -static char *phase_names[] = { +static const char *phase_names[] = { "DATA_OUT", "DATA_IN", "COMMAND", "STATUS", "NONE", "NONE", "MSG_OUT", "MSG_IN" }; @@ -2002,7 +2002,7 @@ struct scsipi_xfer *xs; static void show_request(reqp, qtxt) SC_REQ *reqp; -char *qtxt; +const char *qtxt; { printf("REQ-%s: %d %p[%ld] cmd[0]=%x S=%x M=%x R=%x resid=%d dr_flag=%x %s\n", qtxt, reqp->targ_id, reqp->xdata_ptr, reqp->xdata_len, @@ -2013,7 +2013,7 @@ char *qtxt; show_data_sense(reqp->xs); } -static char *sig_names[] = { +static const char *sig_names[] = { "PAR", "SEL", "I/O", "C/D", "MSG", "REQ", "BSY", "RST", "ACK", "ATN", "LBSY", "PMATCH", "IRQ", "EPAR", "DREQ", "EDMA" }; diff --git a/sys/arch/atari/dev/ncr5380reg.h b/sys/arch/atari/dev/ncr5380reg.h index 5f3fe515148..3bccdf0389e 100644 --- a/sys/arch/atari/dev/ncr5380reg.h +++ b/sys/arch/atari/dev/ncr5380reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380reg.h,v 1.17 2004/12/07 21:12:42 thorpej Exp $ */ +/* $NetBSD: ncr5380reg.h,v 1.18 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -238,10 +238,10 @@ static void finish_req __P((SC_REQ *)); static int handle_message __P((SC_REQ *, u_int)); static int information_transfer __P((struct ncr_softc *)); static void nack_message __P((SC_REQ *, u_char)); -static void ncr_aprint __P((struct ncr_softc *, char *, ...)); +static void ncr_aprint __P((struct ncr_softc *, const char *, ...)); static void ncr_ctrl_intr __P((struct ncr_softc *)); static void ncr_dma_intr __P((struct ncr_softc *)); -static void ncr_tprint __P((SC_REQ *, char *, ...)); +static void ncr_tprint __P((SC_REQ *, const char *, ...)); static int reach_msg_out __P((struct ncr_softc *, u_long)); static void reselect __P((struct ncr_softc *)); static void run_main __P((struct ncr_softc *)); @@ -251,7 +251,7 @@ static void scsi_reset_verbose __P((struct ncr_softc *, const char *)); static int scsi_select __P((SC_REQ *, int)); static void show_data_sense __P((struct scsipi_xfer *)); static void show_phase __P((SC_REQ *, int)); -static void show_request __P((SC_REQ *, char *)); +static void show_request __P((SC_REQ *, const char *)); static void show_signals __P((u_char, u_char)); static void transfer_dma __P((SC_REQ *, u_int, int)); static int transfer_pio __P((u_char *, u_char *, u_long *, int)); diff --git a/sys/arch/atari/dev/ncr5380var.h b/sys/arch/atari/dev/ncr5380var.h index d3b8f1bee27..1cb7f20692d 100644 --- a/sys/arch/atari/dev/ncr5380var.h +++ b/sys/arch/atari/dev/ncr5380var.h @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380var.h,v 1.4 1996/10/13 04:11:10 christos Exp $ */ +/* $NetBSD: ncr5380var.h,v 1.5 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1996 Leo Weppelman. @@ -56,7 +56,7 @@ #endif #ifdef DBG_PID /* static char *last_hit = NULL, *olast_hit = NULL; */ - static char *last_hit[DBG_PID]; + static const char *last_hit[DBG_PID]; # define PID(a) \ { int i; \ for (i=0; i< DBG_PID-1; i++) \ diff --git a/sys/arch/atari/dev/zs.c b/sys/arch/atari/dev/zs.c index 13f7d69a35f..036aa3506b2 100644 --- a/sys/arch/atari/dev/zs.c +++ b/sys/arch/atari/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.42 2004/03/25 10:17:19 leo Exp $ */ +/* $NetBSD: zs.c,v 1.43 2005/06/04 14:42:36 he Exp $ */ /* * Copyright (c) 1992, 1993 @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.42 2004/03/25 10:17:19 leo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.43 2005/06/04 14:42:36 he Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -255,7 +255,7 @@ static struct zs_chanstate *zslist; static void zsstart __P((struct tty *)); /* Routines purely local to this driver. */ -static void zsoverrun __P((int, long *, char *)); +static void zsoverrun __P((int, long *, const char *)); static int zsparam __P((struct tty *, struct termios *)); static int zsbaudrate __P((int, int, int *, int *, int *, int *)); static int zs_modem __P((struct zs_chanstate *, int, int)); @@ -725,7 +725,7 @@ static void zsoverrun(unit, ptime, what) int unit; long *ptime; -char *what; +const char *what; { if(*ptime != time.tv_sec) { |
