Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev more cast-qual and shadow fallout
details: https://anonhg.NetBSD.org/src/rev/4eafeb473656
branches: trunk
changeset: 581453:4eafeb473656
user: drochner <drochner%NetBSD.org@localhost>
date: Wed Jun 01 18:41:51 2005 +0000
description:
more cast-qual and shadow fallout
diffstat:
sys/dev/pci/if_de.c | 27 ++++++++++++++-------------
sys/dev/ppbus/ppbus_base.c | 18 +++++++++---------
sys/dev/sequencer.c | 10 +++++-----
3 files changed, 28 insertions(+), 27 deletions(-)
diffs (225 lines):
diff -r 75a0fde36ad8 -r 4eafeb473656 sys/dev/pci/if_de.c
--- a/sys/dev/pci/if_de.c Wed Jun 01 18:34:12 2005 +0000
+++ b/sys/dev/pci/if_de.c Wed Jun 01 18:41:51 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_de.c,v 1.113 2005/02/27 00:27:32 perry Exp $ */
+/* $NetBSD: if_de.c,v 1.114 2005/06/01 18:41:51 drochner Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt%3am-software.com@localhost)
@@ -37,7 +37,7 @@
* board which support 21040, 21041, or 21140 (mostly).
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.113 2005/02/27 00:27:32 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.114 2005/06/01 18:41:51 drochner Exp $");
#define TULIP_HDR_DATA
@@ -2483,7 +2483,8 @@
unsigned idx1, idx2, idx3;
const tulip_srom_header_t *shp = (tulip_srom_header_t *) &sc->tulip_rombuf[0];
- const tulip_srom_adapter_info_t *saip = (tulip_srom_adapter_info_t *) (shp + 1);
+ const tulip_srom_adapter_info_t *saip =
+ (const tulip_srom_adapter_info_t *) (shp + 1);
tulip_srom_media_t srom_media;
tulip_media_info_t *mi = sc->tulip_mediainfo;
const u_int8_t *dp;
@@ -2504,7 +2505,7 @@
/*
* Save the hardware address.
*/
- memcpy((caddr_t) sc->tulip_enaddr, (caddr_t) shp->sh_ieee802_address,
+ memcpy((caddr_t) sc->tulip_enaddr, shp->sh_ieee802_address,
ETHER_ADDR_LEN);
/*
* If this is a multiple port card, add the adapter index to the last
@@ -3068,7 +3069,7 @@
*/
for (idx = 0; tulip_vendors[idx].vendor_identify_nic != NULL; idx++) {
if (memcmp((caddr_t) sc->tulip_enaddr,
- (caddr_t) tulip_vendors[idx].vendor_oui, 3) == 0) {
+ tulip_vendors[idx].vendor_oui, 3) == 0) {
(*tulip_vendors[idx].vendor_identify_nic)(sc);
break;
}
@@ -4326,7 +4327,7 @@
TULIP_PERFSTART(txput)
tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
tulip_desc_t *eop, *nextout;
- int segcnt, free;
+ int segcnt, freedescs;
u_int32_t d_status;
#if defined(TULIP_BUS_DMA) && !defined(TULIP_BUS_DMA_NOTX)
bus_dmamap_t map;
@@ -4370,7 +4371,7 @@
d_status = 0;
eop = nextout = ri->ri_nextout;
segcnt = 0;
- free = ri->ri_free;
+ freedescs = ri->ri_free;
#if defined(TULIP_BUS_DMA) && !defined(TULIP_BUS_DMA_NOTX)
/*
@@ -4380,7 +4381,7 @@
#if defined(TULIP_DEBUG)
sc->tulip_dbg.dbg_no_txmaps++;
#endif
- free += tulip_tx_intr(sc);
+ freedescs += tulip_tx_intr(sc);
}
if (sc->tulip_txmaps_free > 0) {
map = sc->tulip_txmaps[sc->tulip_txmaps_free-1];
@@ -4417,11 +4418,11 @@
goto finish;
}
}
- if ((free -= (map->dm_nsegs + 1) / 2) <= 0
+ if ((freedescs -= (map->dm_nsegs + 1) / 2) <= 0
/*
* See if there's any unclaimed space in the transmit ring.
*/
- && (free += tulip_tx_intr(sc)) <= 0) {
+ && (freedescs += tulip_tx_intr(sc)) <= 0) {
/*
* There's no more room but since nothing
* has been committed at this point, just
@@ -4490,12 +4491,12 @@
goto again;
}
if (segcnt & 1) {
- if (--free == 0) {
+ if (--freedescs == 0) {
/*
* See if there's any unclaimed space in the
* transmit ring.
*/
- if ((free += tulip_tx_intr(sc)) == 0) {
+ if ((freedescs += tulip_tx_intr(sc)) == 0) {
/*
* There's no more room but since nothing
* has been committed at this point, just
@@ -4591,7 +4592,7 @@
* This advances the ring for us.
*/
ri->ri_nextout = nextout;
- ri->ri_free = free;
+ ri->ri_free = freedescs;
TULIP_PERFEND(txput);
diff -r 75a0fde36ad8 -r 4eafeb473656 sys/dev/ppbus/ppbus_base.c
--- a/sys/dev/ppbus/ppbus_base.c Wed Jun 01 18:34:12 2005 +0000
+++ b/sys/dev/ppbus/ppbus_base.c Wed Jun 01 18:41:51 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ppbus_base.c,v 1.9 2005/02/27 00:27:44 perry Exp $ */
+/* $NetBSD: ppbus_base.c,v 1.10 2005/06/01 18:41:51 drochner Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 Nicolas Souchu
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppbus_base.c,v 1.9 2005/02/27 00:27:44 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppbus_base.c,v 1.10 2005/06/01 18:41:51 drochner Exp $");
#include "opt_ppbus_1284.h"
#include "opt_ppbus.h"
@@ -51,7 +51,7 @@
#ifndef DONTPROBE_1284
/* Utility functions */
-static char * search_token(char *, int, char *);
+static char * search_token(char *, int, const char *);
#endif
/* Perform general ppbus I/O request */
@@ -120,14 +120,14 @@
/* Polls the bus for a max of 10-milliseconds */
int
-ppbus_poll_bus(struct device * dev, int max, char mask, char status,
+ppbus_poll_bus(struct device * dev, int maxp, char mask, char status,
int how)
{
int i, j, error;
char r;
/* try at least up to 10ms */
- for (j = 0; j < ((how & PPBUS_POLL) ? max : 1); j++) {
+ for (j = 0; j < ((how & PPBUS_POLL) ? maxp : 1); j++) {
for (i = 0; i < 10000; i++) {
r = ppbus_rstr(dev);
DELAY(1);
@@ -137,7 +137,7 @@
}
if (!(how & PPBUS_POLL)) {
- for (i = 0; max == PPBUS_FOREVER || i < max-1; i++) {
+ for (i = 0; maxp == PPBUS_FOREVER || i < maxp-1; i++) {
if ((ppbus_rstr(dev) & mask) == status)
return (0);
@@ -467,7 +467,7 @@
#ifndef DONTPROBE_1284
-static char *pnp_tokens[] = {
+static const char *pnp_tokens[] = {
"PRINTER", "MODEM", "NET", "HDC", "PCMCIA", "MEDIA",
"FDC", "PORTS", "SCANNER", "DIGICAM", "", NULL };
@@ -485,9 +485,9 @@
* XXX should use strxxx() calls
*/
static char *
-search_token(char *str, int slen, char *token)
+search_token(char *str, int slen, const char *token)
{
- char *p;
+ const char *p;
int tlen, i, j;
#define UNKNOWN_LENGTH -1
diff -r 75a0fde36ad8 -r 4eafeb473656 sys/dev/sequencer.c
--- a/sys/dev/sequencer.c Wed Jun 01 18:34:12 2005 +0000
+++ b/sys/dev/sequencer.c Wed Jun 01 18:41:51 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sequencer.c,v 1.28 2005/05/29 22:18:25 christos Exp $ */
+/* $NetBSD: sequencer.c,v 1.29 2005/06/01 18:41:51 drochner Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.28 2005/05/29 22:18:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sequencer.c,v 1.29 2005/06/01 18:41:51 drochner Exp $");
#include "sequencer.h"
@@ -1068,7 +1068,7 @@
struct uio *uio;
{
int cmd, chan, note, parm;
- u_int32_t delay;
+ u_int32_t tmp_delay;
int error;
cmd = SEQ_CMD(ev);
@@ -1103,10 +1103,10 @@
SEQ_EPARM(ev) = parm;
break;
case SEQOLD_WAIT:
- delay = *(u_int32_t *)ev->arr >> 8;
+ tmp_delay = *(u_int32_t *)ev->arr >> 8;
SEQ_CMD(ev) = SEQ_TIMING;
SEQ_TCMD(ev) = TMR_WAIT_REL;
- *(u_int32_t *)&ev->arr[4] = delay;
+ *(u_int32_t *)&ev->arr[4] = tmp_delay;
break;
case SEQOLD_SYNCTIMER:
SEQ_CMD(ev) = SEQ_TIMING;
Home |
Main Index |
Thread Index |
Old Index