Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Fixes due to cast-qual addition.
details: https://anonhg.NetBSD.org/src/rev/51a10a6fdec4
branches: trunk
changeset: 582438:51a10a6fdec4
user: ragge <ragge%NetBSD.org@localhost>
date: Mon Jun 27 11:05:24 2005 +0000
description:
Fixes due to cast-qual addition.
diffstat:
sys/dev/bi/bivar.h | 4 ++--
sys/dev/bi/if_ni.c | 23 ++++++++++-------------
sys/dev/mscp/mscp_subr.c | 38 ++++++++++++++++++++------------------
sys/dev/mscp/mscp_tape.c | 6 +++---
sys/dev/mscp/mscpvar.h | 4 ++--
sys/dev/qbus/if_de.c | 10 +++++-----
sys/dev/qbus/rl.c | 10 +++++-----
sys/dev/qbus/uda.c | 6 +++---
8 files changed, 50 insertions(+), 51 deletions(-)
diffs (truncated from 421 to 300 lines):
diff -r 8e79a0e89f98 -r 51a10a6fdec4 sys/dev/bi/bivar.h
--- a/sys/dev/bi/bivar.h Mon Jun 27 11:03:58 2005 +0000
+++ b/sys/dev/bi/bivar.h Mon Jun 27 11:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bivar.h,v 1.10 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: bivar.h,v 1.11 2005/06/27 11:05:24 ragge Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -66,7 +66,7 @@
struct bi_list {
u_short bl_nr; /* Unit ID# */
u_short bl_havedriver; /* Have device driver (informal) */
- char *bl_name; /* DEC name */
+ const char *bl_name; /* DEC name */
};
/* bl_havedriver field meaning */
diff -r 8e79a0e89f98 -r 51a10a6fdec4 sys/dev/bi/if_ni.c
--- a/sys/dev/bi/if_ni.c Mon Jun 27 11:03:58 2005 +0000
+++ b/sys/dev/bi/if_ni.c Mon Jun 27 11:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ni.c,v 1.25 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: if_ni.c,v 1.26 2005/06/27 11:05:24 ragge Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
*
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.25 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.26 2005/06/27 11:05:24 ragge Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -99,22 +99,22 @@
*/
#define NRETRIES 100
#define INSQTI(e, h) ({ \
- int ret = 0, i; \
- for (i = 0; i < NRETRIES; i++) { \
+ int ret = 0, __i; \
+ for (__i = 0; __i < NRETRIES; __i++) { \
if ((ret = insqti(e, h)) != ILCK_FAILED) \
break; \
} \
- if (i == NRETRIES) \
+ if (__i == NRETRIES) \
panic("ni: insqti failed at %d", __LINE__); \
ret; \
})
#define REMQHI(h) ({ \
- int i; void *ret = NULL; \
- for (i = 0; i < NRETRIES; i++) { \
+ int __i; void *ret = NULL; \
+ for (__i = 0; __i < NRETRIES; __i++) { \
if ((ret = remqhi(h)) != (void *)ILCK_FAILED) \
break; \
} \
- if (i == NRETRIES) \
+ if (__i == NRETRIES) \
panic("ni: remqhi failed at %d", __LINE__); \
ret; \
})
@@ -151,7 +151,7 @@
static void nitimeout(struct ifnet *);
static void ni_shutdown(void *);
static void ni_getpgs(struct ni_softc *sc, int size, caddr_t *v, paddr_t *p);
-static int failtest(struct ni_softc *, int, int, int, char *);
+static int failtest(struct ni_softc *, int, int, int, const char *);
volatile int endwait, retry; /* Used during autoconfig */
@@ -211,7 +211,7 @@
}
static int
-failtest(struct ni_softc *sc, int reg, int mask, int test, char *str)
+failtest(struct ni_softc *sc, int reg, int mask, int test, const char *str)
{
int i = 100;
@@ -353,10 +353,7 @@
/* Set up message free queue */
ni_getpgs(sc, NMSGBUF * 512, &va, 0);
for (i = 0; i < NMSGBUF; i++) {
- struct ni_msg *msg;
-
msg = (void *)(va + i * 512);
-
res = INSQTI(msg, &fqb->nf_mforw);
}
WAITREG(NI_PCR, PCR_OWN);
diff -r 8e79a0e89f98 -r 51a10a6fdec4 sys/dev/mscp/mscp_subr.c
--- a/sys/dev/mscp/mscp_subr.c Mon Jun 27 11:03:58 2005 +0000
+++ b/sys/dev/mscp/mscp_subr.c Mon Jun 27 11:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp_subr.c,v 1.27 2005/02/27 00:27:32 perry Exp $ */
+/* $NetBSD: mscp_subr.c,v 1.28 2005/06/27 11:05:24 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.27 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.28 2005/06/27 11:05:24 ragge Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -167,6 +167,7 @@
{
struct mscp_attach_args *ma = aux;
struct mscp_softc *mi = (void *)self;
+ struct mscp *mp2;
volatile struct mscp *mp;
volatile int i;
int timeout, next = 0;
@@ -297,7 +298,8 @@
*/
printf("%s: unit %d off line: ", mi->mi_dev.dv_xname,
mp->mscp_unit);
- mscp_printevent((struct mscp *)mp);
+ mp2 = __UNVOLATILE(mp);
+ mscp_printevent(mp2);
next++;
goto findunit;
}
@@ -305,7 +307,7 @@
default:
printf("%s: unable to get unit status: ", mi->mi_dev.dv_xname);
- mscp_printevent((struct mscp *)mp);
+ mscp_printevent(__UNVOLATILE(mp));
return;
}
@@ -622,7 +624,7 @@
/*
* Subcodes for Success (0)
*/
-static char *succ_msgs[] = {
+static const char *succ_msgs[] = {
"normal", /* 0 */
"spin down ignored", /* 1 = Spin-Down Ignored */
"still connected", /* 2 = Still Connected */
@@ -645,7 +647,7 @@
/*
* Subcodes for Invalid Command (1)
*/
-static char *icmd_msgs[] = {
+static const char *icmd_msgs[] = {
"invalid msg length", /* 0 = Invalid Message Length */
};
@@ -657,7 +659,7 @@
/*
* Subcodes for Unit Offline (3)
*/
-static char *offl_msgs[] = {
+static const char *offl_msgs[] = {
"unknown drive", /* 0 = Unknown, or online to other ctlr */
"not mounted", /* 1 = Unmounted, or RUN/STOP at STOP */
"inoperative", /* 2 = Unit Inoperative */
@@ -677,7 +679,7 @@
/*
* Subcodes for Media Format Error (5)
*/
-static char *media_fmt_msgs[] = {
+static const char *media_fmt_msgs[] = {
"fct unread - edc", /* 0 = FCT unreadable */
"invalid sector header",/* 1 = Invalid Sector Header */
"not 512 sectors", /* 2 = Not 512 Byte Sectors */
@@ -690,7 +692,7 @@
* N.B.: Code 6 subcodes are 7 bits higher than other subcodes
* (i.e., bits 12-15).
*/
-static char *wrprot_msgs[] = {
+static const char *wrprot_msgs[] = {
unknown_msg,
"software", /* 1 = Software Write Protect */
"hardware", /* 2 = Hardware Write Protect */
@@ -704,7 +706,7 @@
/*
* Subcodes for Data Error (8)
*/
-static char *data_msgs[] = {
+static const char *data_msgs[] = {
"forced error", /* 0 = Forced Error (software) */
unknown_msg,
"header compare", /* 2 = Header Compare Error */
@@ -726,7 +728,7 @@
/*
* Subcodes for Host Buffer Access Error (9)
*/
-static char *host_buffer_msgs[] = {
+static const char *host_buffer_msgs[] = {
unknown_msg,
"odd xfer addr", /* 1 = Odd Transfer Address */
"odd xfer count", /* 2 = Odd Transfer Count */
@@ -737,7 +739,7 @@
/*
* Subcodes for Controller Error (10)
*/
-static char *cntlr_msgs[] = {
+static const char *cntlr_msgs[] = {
unknown_msg,
"serdes overrun", /* 1 = Serialiser/Deserialiser Overrun */
"edc", /* 2 = Error Detection Code? */
@@ -747,7 +749,7 @@
/*
* Subcodes for Drive Error (11)
*/
-static char *drive_msgs[] = {
+static const char *drive_msgs[] = {
unknown_msg,
"sdi command timeout", /* 1 = SDI Command Timeout */
"ctlr detected protocol",/* 2 = Controller Detected Protocol Error */
@@ -764,9 +766,9 @@
* decoding strings.
*/
struct code_decode {
- char *cdc_msg;
+ const char *cdc_msg;
int cdc_nsubcodes;
- char **cdc_submsgs;
+ const char **cdc_submsgs;
} code_decode[] = {
#define SC(m) sizeof (m) / sizeof (m[0]), m
{"success", SC(succ_msgs)},
@@ -794,7 +796,7 @@
int event = mp->mscp_event;
struct code_decode *cdc;
int c, sc;
- char *cm, *scm;
+ const char *cm, *scm;
/*
* The code is the lower six bits of the event number (aka
@@ -818,7 +820,7 @@
printf(" %s (%s) (code %d, subcode %d)\n", cm, scm, c, sc);
}
-static char *codemsg[16] = {
+static const char *codemsg[16] = {
"lbn", "code 1", "code 2", "code 3",
"code 4", "code 5", "rbn", "code 7",
"code 8", "code 9", "code 10", "code 11",
@@ -831,7 +833,7 @@
*/
int
mscp_decodeerror(name, mp, mi)
- char *name;
+ const char *name;
struct mscp *mp;
struct mscp_softc *mi;
{
diff -r 8e79a0e89f98 -r 51a10a6fdec4 sys/dev/mscp/mscp_tape.c
--- a/sys/dev/mscp/mscp_tape.c Mon Jun 27 11:03:58 2005 +0000
+++ b/sys/dev/mscp/mscp_tape.c Mon Jun 27 11:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp_tape.c,v 1.24 2005/02/27 00:27:32 perry Exp $ */
+/* $NetBSD: mscp_tape.c,v 1.25 2005/06/27 11:05:24 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.24 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.25 2005/06/27 11:05:24 ragge Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -380,7 +380,7 @@
return (MSCP_DONE);
}
-static char *mt_ioerrs[] = {
+static const char *mt_ioerrs[] = {
"invalid command", /* 1 M_ST_INVALCMD */
"command aborted", /* 2 M_ST_ABORTED */
"unit offline", /* 3 M_ST_OFFLINE */
diff -r 8e79a0e89f98 -r 51a10a6fdec4 sys/dev/mscp/mscpvar.h
--- a/sys/dev/mscp/mscpvar.h Mon Jun 27 11:03:58 2005 +0000
+++ b/sys/dev/mscp/mscpvar.h Mon Jun 27 11:05:24 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mscpvar.h,v 1.11 2005/02/04 02:10:43 perry Exp $ */
+/* $NetBSD: mscpvar.h,v 1.12 2005/06/27 11:05:24 ragge Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -272,7 +272,7 @@
void mscp_go(struct mscp_softc *, struct mscp *, int);
void mscp_requeue(struct mscp_softc *);
void mscp_dorsp(struct mscp_softc *);
-int mscp_decodeerror(char *, struct mscp *, struct mscp_softc *);
Home |
Main Index |
Thread Index |
Old Index