summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-07-01 15:52:50 +0000
committerimp <imp@FreeBSD.org>2005-07-01 15:52:50 +0000
commit02c2d90f46ccecd39658689921e212d8dd15f796 (patch)
tree0b8759593b5d40ca2489dd80607e5accc80abdda /sys/dev/pccard
parentbad5ea90fcf051fa5d42f7028e4329b3e022689c (diff)
downloadFreeBSD-src-02c2d90f46ccecd39658689921e212d8dd15f796.zip
FreeBSD-src-02c2d90f46ccecd39658689921e212d8dd15f796.tar.gz
Upon relection, we shouldn't allow the tuple structs to be modified by
the functor, so make it a const pointer, and chase down the resulting const-poisoning. Approved by: re (scottl)
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard_cis.c14
-rw-r--r--sys/dev/pccard/pccardvar.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c
index 7c7898e..6a965e7 100644
--- a/sys/dev/pccard/pccard_cis.c
+++ b/sys/dev/pccard/pccard_cis.c
@@ -71,8 +71,8 @@ struct cis_state {
struct pccard_function *pf;
};
-static int pccard_parse_cis_tuple(struct pccard_tuple *, void *);
-static int decode_funce(struct pccard_tuple *, struct pccard_function *);
+static int pccard_parse_cis_tuple(const struct pccard_tuple *, void *);
+static int decode_funce(const struct pccard_tuple *, struct pccard_function *);
void
pccard_read_cis(struct pccard_softc *sc)
@@ -80,9 +80,7 @@ pccard_read_cis(struct pccard_softc *sc)
struct cis_state state;
bzero(&state, sizeof state);
-
state.card = &sc->card;
-
state.card->error = 0;
state.card->cis1_major = -1;
state.card->cis1_minor = -1;
@@ -93,7 +91,6 @@ pccard_read_cis(struct pccard_softc *sc)
state.card->manufacturer = PCMCIA_VENDOR_INVALID;
state.card->product = PCMCIA_PRODUCT_INVALID;
STAILQ_INIT(&state.card->pf_head);
-
state.pf = NULL;
tsleep(&state, 0, "pccard", hz);
@@ -616,7 +613,7 @@ pccard_print_cis(device_t dev)
}
static int
-pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
+pccard_parse_cis_tuple(const struct pccard_tuple *tuple, void *arg)
{
/* most of these are educated guesses */
static struct pccard_config_entry init_cfe = {
@@ -813,9 +810,8 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
"valid CISTPL_FUNCID\n"));
break;
}
- if (tuple->length >= 2) {
+ if (tuple->length >= 2)
decode_funce(tuple, state->pf);
- }
DPRINTF(("CISTPL_FUNCE\n"));
break;
case CISTPL_CONFIG:
@@ -1268,7 +1264,7 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
}
static int
-decode_funce(struct pccard_tuple *tuple, struct pccard_function *pf)
+decode_funce(const struct pccard_tuple *tuple, struct pccard_function *pf)
{
int i;
int len;
diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h
index 3df9fcc..20ef302 100644
--- a/sys/dev/pccard/pccardvar.h
+++ b/sys/dev/pccard/pccardvar.h
@@ -221,7 +221,7 @@ struct pccard_tuple {
bus_space_handle_t memh;
};
-typedef int (*pccard_scan_t)(struct pccard_tuple *, void *);
+typedef int (*pccard_scan_t)(const struct pccard_tuple *, void *);
struct pccard_product {
const char *pp_name; /* NULL if end of table */
OpenPOWER on IntegriCloud