From da44240f1a0a5258ca269338fffe31e86c69fb92 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 28 Aug 2010 22:37:24 -0700 Subject: [PATCH] kernel - gcc -Os/-O2 warnings pass * This is just a partial pass on the code to start cleaning up gcc warnings at higher optimization levels. --- sys/bus/cam/cam_periph.c | 12 ++--- sys/bus/cam/scsi/scsi_sa.c | 18 ++++--- sys/bus/firewire/firewire.c | 2 +- sys/bus/firewire/fwcrom.c | 6 +-- sys/ddb/db_expr.c | 4 ++ sys/dev/disk/advansys/adv_eisa.c | 2 +- sys/dev/disk/advansys/adv_pci.c | 2 +- sys/dev/disk/advansys/advansys.c | 2 +- sys/dev/disk/advansys/adwcam.c | 6 +-- sys/dev/disk/aha/aha.c | 6 +-- sys/dev/disk/ahb/ahb.c | 2 +- sys/dev/disk/aic7xxx/aic79xx.c | 8 ++-- sys/dev/disk/aic7xxx/aic79xx_inline.h | 2 +- sys/dev/disk/aic7xxx/aic7xxx.c | 8 ++-- sys/dev/disk/buslogic/bt.c | 6 +-- sys/dev/disk/buslogic/bt_isa.c | 2 +- sys/dev/disk/isp/isp.c | 4 +- sys/dev/disk/isp/isp_freebsd.c | 2 +- sys/dev/disk/isp/isp_pci.c | 2 +- sys/dev/disk/nata/ata-dma.c | 4 +- sys/dev/disk/nata/ata-raid.c | 13 ++++- sys/dev/netif/an/if_an.c | 69 ++++++++++++++------------- sys/dev/netif/bge/if_bge.c | 12 ++--- sys/dev/netif/msk/if_msk.c | 4 +- sys/dev/netif/nfe/if_nfe.c | 8 ++-- sys/dev/pccard/pccbb/pccbb.c | 6 +-- sys/dev/raid/amr/amr_pci.c | 4 +- sys/dev/raid/ciss/ciss.c | 8 ++-- sys/dev/raid/dpt/dpt_scsi.c | 4 +- sys/dev/raid/ida/ida.c | 2 +- sys/dev/raid/iir/iir.c | 2 +- sys/dev/raid/mlx/mlx.c | 2 +- 32 files changed, 126 insertions(+), 108 deletions(-) diff --git a/sys/bus/cam/cam_periph.c b/sys/bus/cam/cam_periph.c index 412d91b582..a885fefdb7 100644 --- a/sys/bus/cam/cam_periph.c +++ b/sys/bus/cam/cam_periph.c @@ -612,15 +612,15 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) return(EINVAL); } if (ccb->cdm.pattern_buf_len > 0) { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns; + data_ptrs[0] = (void *)&ccb->cdm.patterns; lengths[0] = ccb->cdm.pattern_buf_len; mapinfo->dirs[0] = CAM_DIR_OUT; - data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[1] = (void *)&ccb->cdm.matches; lengths[1] = ccb->cdm.match_buf_len; mapinfo->dirs[1] = CAM_DIR_IN; numbufs = 2; } else { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[0] = (void *)&ccb->cdm.matches; lengths[0] = ccb->cdm.match_buf_len; mapinfo->dirs[0] = CAM_DIR_IN; numbufs = 1; @@ -785,10 +785,10 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) numbufs = min(mapinfo->num_bufs_used, 2); if (numbufs == 1) { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[0] = (void *)&ccb->cdm.matches; } else { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns; - data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[0] = (void *)&ccb->cdm.patterns; + data_ptrs[1] = (void *)&ccb->cdm.matches; } break; case XPT_SCSI_IO: diff --git a/sys/bus/cam/scsi/scsi_sa.c b/sys/bus/cam/scsi/scsi_sa.c index 8866fcb919..29cbbea127 100644 --- a/sys/bus/cam/scsi/scsi_sa.c +++ b/sys/bus/cam/scsi/scsi_sa.c @@ -933,8 +933,10 @@ saioctl(struct dev_ioctl_args *ap) * and ask the drive again what it's set to. */ if (!SA_IS_CTRL(dev) && !softc->open_pending_mount) { - u_int8_t write_protect; - int comp_enabled, comp_supported; + u_int8_t write_protect = 0; /* silence gcc */ + int comp_enabled = 0; /* silence gcc */ + int comp_supported = 0; /* silence gcc */ + error = sagetparams(periph, SA_PARAM_ALL, &softc->media_blksize, &softc->media_density, &softc->media_numblks, &softc->buffer_mode, @@ -1908,8 +1910,10 @@ samount(struct cam_periph *periph, int oflags, cdev_t dev) if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) { struct scsi_read_block_limits_data *rblim = NULL; - int comp_enabled, comp_supported; - u_int8_t write_protect, guessing = 0; + int comp_enabled = 0; /* silence gcc */ + int comp_supported = 0; /* silence gcc */ + u_int8_t write_protect = 0; /* silence gcc */ + u_int8_t guessing = 0; /* * Clear out old state. @@ -2729,10 +2733,10 @@ sasetparams(struct cam_periph *periph, sa_params params_to_set, u_int32_t sense_flags) { struct sa_softc *softc; - u_int32_t current_blocksize; + u_int32_t current_blocksize = 0;/* silence gcc */ u_int32_t current_calg; - u_int8_t current_density; - u_int8_t current_speed; + u_int8_t current_density = 0; /* silence gcc */ + u_int8_t current_speed = 0; /* silence gcc */ int comp_enabled, comp_supported; void *mode_buffer; int mode_buffer_len; diff --git a/sys/bus/firewire/firewire.c b/sys/bus/firewire/firewire.c index f1cb651b8e..955b93cc8f 100644 --- a/sys/bus/firewire/firewire.c +++ b/sys/bus/firewire/firewire.c @@ -1489,7 +1489,7 @@ fw_bus_explore_callback(struct fw_xfer *xfer) if(fc->ongodev == NULL){ if(sfp->mode.rreqq.dest_lo == (0xf0000000 | CSRROMOFF)){ rfp->mode.rresq.data = ntohl(rfp->mode.rresq.data); - chdr = (struct csrhdr *)(&rfp->mode.rresq.data); + chdr = (struct csrhdr *)(void *)(&rfp->mode.rresq.data); /* If CSR is minimal confinguration, more investgation is not needed. */ if(chdr->info_len == 1){ if (firewire_debug) diff --git a/sys/bus/firewire/fwcrom.c b/sys/bus/firewire/fwcrom.c index 45407f672c..6d7fb805bc 100644 --- a/sys/bus/firewire/fwcrom.c +++ b/sys/bus/firewire/fwcrom.c @@ -416,7 +416,7 @@ crom_add_entry(struct crom_chunk *chunk, int key, int val) struct csrreg *reg; u_int32_t i; - reg = (struct csrreg *)&i; + reg = (struct csrreg *)(void *)&i; reg->key = key; reg->val = val; return(crom_add_quad(chunk, (u_int32_t) i)); @@ -463,7 +463,7 @@ crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent, len = MAX_TEXT; } - tl = (struct csrtext *) &chunk->data; + tl = (struct csrtext *)(void *)&chunk->data; tl->crc_len = howmany(sizeof(struct csrtext) + len, sizeof(u_int32_t)); tl->spec_id = 0; tl->spec_type = 0; @@ -519,7 +519,7 @@ crom_load(struct crom_src *src, u_int32_t *buf, int maxlen) /* Calculate CRC and dump to the buffer */ len = 1 + src->hdr.info_len; count = 0; - if (crom_copy((u_int32_t *)&src->hdr, buf, &count, len, maxlen) < 0) + if (crom_copy((u_int32_t *)(void *)&src->hdr, buf, &count, len, maxlen) < 0) return(-1); STAILQ_FOREACH(chunk, &src->chunk_list, link) { chunk->data.crc = diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c index 11a793a06e..85a1a71297 100644 --- a/sys/ddb/db_expr.c +++ b/sys/ddb/db_expr.c @@ -131,6 +131,8 @@ db_mult_expr(db_expr_t *valuep) db_expr_t lhs, rhs; int t; + *valuep = 0; /* silence gcc */ + if (!db_unary(&lhs)) return (FALSE); @@ -167,6 +169,8 @@ db_add_expr(db_expr_t *valuep) db_expr_t lhs, rhs; int t; + *valuep = 0; /* silence gcc */ + if (!db_mult_expr(&lhs)) return (FALSE); diff --git a/sys/dev/disk/advansys/adv_eisa.c b/sys/dev/disk/advansys/adv_eisa.c index 6c47a9c19e..62d834c66d 100644 --- a/sys/dev/disk/advansys/adv_eisa.c +++ b/sys/dev/disk/advansys/adv_eisa.c @@ -247,7 +247,7 @@ adv_eisa_attach(device_t dev) goto bad; } if (bus_dmamem_alloc(overrun_dmat, - (void **)&overrun_buf, + (void *)&overrun_buf, BUS_DMA_NOWAIT, &overrun_dmamap) != 0) { bus_dma_tag_destroy(overrun_dmat); diff --git a/sys/dev/disk/advansys/adv_pci.c b/sys/dev/disk/advansys/adv_pci.c index 6e748e6c4b..afae89d67b 100644 --- a/sys/dev/disk/advansys/adv_pci.c +++ b/sys/dev/disk/advansys/adv_pci.c @@ -218,7 +218,7 @@ adv_pci_attach(device_t dev) return ENXIO; } if (bus_dmamem_alloc(overrun_dmat, - (void **)&overrun_buf, + (void *)&overrun_buf, BUS_DMA_NOWAIT, &overrun_dmamap) != 0) { bus_dma_tag_destroy(overrun_dmat); diff --git a/sys/dev/disk/advansys/advansys.c b/sys/dev/disk/advansys/advansys.c index 04c94a2a3b..9bf86f588e 100644 --- a/sys/dev/disk/advansys/advansys.c +++ b/sys/dev/disk/advansys/advansys.c @@ -1360,7 +1360,7 @@ adv_attach(struct adv_softc *adv) adv->init_level++; /* Allocation for our sense buffers */ - if (bus_dmamem_alloc(adv->sense_dmat, (void **)&adv->sense_buffers, + if (bus_dmamem_alloc(adv->sense_dmat, (void *)&adv->sense_buffers, BUS_DMA_NOWAIT, &adv->sense_dmamap) != 0) { return (ENOMEM); } diff --git a/sys/dev/disk/advansys/adwcam.c b/sys/dev/disk/advansys/adwcam.c index 2e40ed046d..22ca4b8917 100644 --- a/sys/dev/disk/advansys/adwcam.c +++ b/sys/dev/disk/advansys/adwcam.c @@ -160,7 +160,7 @@ adwallocsgmap(struct adw_softc *adw) sg_map = kmalloc(sizeof(*sg_map), M_DEVBUF, M_INTWAIT); /* Allocate S/G space for the next batch of ACBS */ - if (bus_dmamem_alloc(adw->sg_dmat, (void **)&sg_map->sg_vaddr, + if (bus_dmamem_alloc(adw->sg_dmat, (void *)&sg_map->sg_vaddr, BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { kfree(sg_map, M_DEVBUF); return (NULL); @@ -1051,7 +1051,7 @@ adw_init(struct adw_softc *adw) adw->init_level++; /* Allocation for our ccb carrier structures */ - if (bus_dmamem_alloc(adw->carrier_dmat, (void **)&adw->carriers, + if (bus_dmamem_alloc(adw->carrier_dmat, (void *)&adw->carriers, BUS_DMA_NOWAIT, &adw->carrier_dmamap) != 0) { return (ENOMEM); } @@ -1105,7 +1105,7 @@ adw_init(struct adw_softc *adw) adw->init_level++; /* Allocation for our ccbs */ - if (bus_dmamem_alloc(adw->acb_dmat, (void **)&adw->acbs, + if (bus_dmamem_alloc(adw->acb_dmat, (void *)&adw->acbs, BUS_DMA_NOWAIT, &adw->acb_dmamap) != 0) return (ENOMEM); diff --git a/sys/dev/disk/aha/aha.c b/sys/dev/disk/aha/aha.c index faa002650f..ca140fce43 100644 --- a/sys/dev/disk/aha/aha.c +++ b/sys/dev/disk/aha/aha.c @@ -543,7 +543,7 @@ aha_init(struct aha_softc* aha) aha->init_level++; /* Allocation for our mailboxes */ - if (bus_dmamem_alloc(aha->mailbox_dmat, (void **)&aha->out_boxes, + if (bus_dmamem_alloc(aha->mailbox_dmat, (void *)&aha->out_boxes, BUS_DMA_NOWAIT, &aha->mailbox_dmamap) != 0) { goto error_exit; } @@ -578,7 +578,7 @@ aha_init(struct aha_softc* aha) aha->init_level++; /* Allocation for our ccbs */ - if (bus_dmamem_alloc(aha->ccb_dmat, (void **)&aha->aha_ccb_array, + if (bus_dmamem_alloc(aha->ccb_dmat, (void *)&aha->aha_ccb_array, BUS_DMA_NOWAIT, &aha->ccb_dmamap) != 0) { goto error_exit; } @@ -723,7 +723,7 @@ ahaallocccbs(struct aha_softc *aha) sg_map = kmalloc(sizeof(*sg_map), M_DEVBUF, M_INTWAIT); /* Allocate S/G space for the next batch of CCBS */ - if (bus_dmamem_alloc(aha->sg_dmat, (void **)&sg_map->sg_vaddr, + if (bus_dmamem_alloc(aha->sg_dmat, (void *)&sg_map->sg_vaddr, BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { kfree(sg_map, M_DEVBUF); return; diff --git a/sys/dev/disk/ahb/ahb.c b/sys/dev/disk/ahb/ahb.c index ad9517dacb..24a41eb28c 100644 --- a/sys/dev/disk/ahb/ahb.c +++ b/sys/dev/disk/ahb/ahb.c @@ -316,7 +316,7 @@ ahbattach(device_t dev) ahb->init_level++; /* Allocation for our ccbs */ - if (bus_dmamem_alloc(ahb->ecb_dmat, (void **)&ahb->ecb_array, + if (bus_dmamem_alloc(ahb->ecb_dmat, (void *)&ahb->ecb_array, BUS_DMA_NOWAIT, &ahb->ecb_dmamap) != 0) goto error_exit; diff --git a/sys/dev/disk/aic7xxx/aic79xx.c b/sys/dev/disk/aic7xxx/aic79xx.c index 50c366e6f0..94201145fa 100644 --- a/sys/dev/disk/aic7xxx/aic79xx.c +++ b/sys/dev/disk/aic7xxx/aic79xx.c @@ -6027,7 +6027,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of hardware SCBs */ if (aic_dmamem_alloc(ahd, scb_data->hscb_dmat, - (void **)&hscb_map->vaddr, + (void *)&hscb_map->vaddr, BUS_DMA_NOWAIT, &hscb_map->dmamap) != 0) { kfree(hscb_map, M_DEVBUF); return (0); @@ -6057,7 +6057,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of S/G lists */ if (aic_dmamem_alloc(ahd, scb_data->sg_dmat, - (void **)&sg_map->vaddr, + (void *)&sg_map->vaddr, BUS_DMA_NOWAIT, &sg_map->dmamap) != 0) { kfree(sg_map, M_DEVBUF); return (0); @@ -6091,7 +6091,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of sense buffers */ if (aic_dmamem_alloc(ahd, scb_data->sense_dmat, - (void **)&sense_map->vaddr, + (void *)&sense_map->vaddr, BUS_DMA_NOWAIT, &sense_map->dmamap) != 0) { kfree(sense_map, M_DEVBUF); return (0); @@ -6309,7 +6309,7 @@ ahd_init(struct ahd_softc *ahd) /* Allocation of driver data */ if (aic_dmamem_alloc(ahd, ahd->shared_data_dmat, - (void **)&ahd->shared_data_map.vaddr, + (void *)&ahd->shared_data_map.vaddr, BUS_DMA_NOWAIT, &ahd->shared_data_map.dmamap) != 0) { return (ENOMEM); diff --git a/sys/dev/disk/aic7xxx/aic79xx_inline.h b/sys/dev/disk/aic7xxx/aic79xx_inline.h index 73f32e85c4..1841831ea8 100644 --- a/sys/dev/disk/aic7xxx/aic79xx_inline.h +++ b/sys/dev/disk/aic7xxx/aic79xx_inline.h @@ -303,7 +303,7 @@ ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) uint32_t *dataptr_words; sg = (struct ahd_dma_seg *)scb->sg_list; - dataptr_words = (uint32_t*)&scb->hscb->dataptr; + dataptr_words = (uint32_t*)(void *)&scb->hscb->dataptr; dataptr_words[0] = sg->addr; dataptr_words[1] = 0; if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) { diff --git a/sys/dev/disk/aic7xxx/aic7xxx.c b/sys/dev/disk/aic7xxx/aic7xxx.c index 8131e8aa07..06dee13617 100644 --- a/sys/dev/disk/aic7xxx/aic7xxx.c +++ b/sys/dev/disk/aic7xxx/aic7xxx.c @@ -4353,7 +4353,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) /* Allocation for our hscbs */ if (aic_dmamem_alloc(ahc, scb_data->hscb_dmat, - (void **)&scb_data->hscbs, + (void *)&scb_data->hscbs, BUS_DMA_NOWAIT, &scb_data->hscb_dmamap) != 0) { goto error_exit; } @@ -4385,7 +4385,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) /* Allocate them */ if (aic_dmamem_alloc(ahc, scb_data->sense_dmat, - (void **)&scb_data->sense, + (void *)&scb_data->sense, BUS_DMA_NOWAIT, &scb_data->sense_dmamap) != 0) { goto error_exit; } @@ -4518,7 +4518,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) /* Allocate S/G space for the next batch of SCBS */ if (aic_dmamem_alloc(ahc, scb_data->sg_dmat, - (void **)&sg_map->sg_vaddr, + (void *)&sg_map->sg_vaddr, BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { kfree(sg_map, M_DEVBUF); return (0); @@ -4908,7 +4908,7 @@ ahc_init(struct ahc_softc *ahc) /* Allocation of driver data */ if (aic_dmamem_alloc(ahc, ahc->shared_data_dmat, - (void **)&ahc->qoutfifo, + (void *)&ahc->qoutfifo, BUS_DMA_NOWAIT, &ahc->shared_data_dmamap) != 0) { return (ENOMEM); } diff --git a/sys/dev/disk/buslogic/bt.c b/sys/dev/disk/buslogic/bt.c index b016eb70f6..3dc2c1eae2 100644 --- a/sys/dev/disk/buslogic/bt.c +++ b/sys/dev/disk/buslogic/bt.c @@ -720,7 +720,7 @@ bt_init(device_t dev) bt->init_level++; /* Allocation for our mailboxes */ - if (bus_dmamem_alloc(bt->mailbox_dmat, (void **)&bt->out_boxes, + if (bus_dmamem_alloc(bt->mailbox_dmat, (void *)&bt->out_boxes, BUS_DMA_NOWAIT, &bt->mailbox_dmamap) != 0) { goto error_exit; } @@ -755,7 +755,7 @@ bt_init(device_t dev) bt->init_level++; /* Allocation for our ccbs */ - if (bus_dmamem_alloc(bt->ccb_dmat, (void **)&bt->bt_ccb_array, + if (bus_dmamem_alloc(bt->ccb_dmat, (void *)&bt->bt_ccb_array, BUS_DMA_NOWAIT, &bt->ccb_dmamap) != 0) { goto error_exit; } @@ -955,7 +955,7 @@ btallocccbs(struct bt_softc *bt) sg_map = kmalloc(sizeof(*sg_map), M_DEVBUF, M_WAITOK); /* Allocate S/G space for the next batch of CCBS */ - if (bus_dmamem_alloc(bt->sg_dmat, (void **)&sg_map->sg_vaddr, + if (bus_dmamem_alloc(bt->sg_dmat, (void *)&sg_map->sg_vaddr, BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { kfree(sg_map, M_DEVBUF); goto error_exit; diff --git a/sys/dev/disk/buslogic/bt_isa.c b/sys/dev/disk/buslogic/bt_isa.c index f6a284844f..8bc267b676 100644 --- a/sys/dev/disk/buslogic/bt_isa.c +++ b/sys/dev/disk/buslogic/bt_isa.c @@ -266,7 +266,7 @@ bt_isa_attach(device_t dev) /* Allocation of sense buffers */ if (bus_dmamem_alloc(bt->sense_dmat, - (void **)&bt->sense_buffers, + (void *)&bt->sense_buffers, BUS_DMA_NOWAIT, &bt->sense_dmamap) != 0) { bt_isa_release_resources(dev); return (ENOMEM); diff --git a/sys/dev/disk/isp/isp.c b/sys/dev/disk/isp/isp.c index 7fbff2366b..b483918f69 100644 --- a/sys/dev/disk/isp/isp.c +++ b/sys/dev/disk/isp/isp.c @@ -3154,7 +3154,7 @@ isp_start(XS_T *xs) isp_update(isp); } - if (isp_getrqentry(isp, &nxti, &optr, (void **)&qep)) { + if (isp_getrqentry(isp, &nxti, &optr, (void *)&qep)) { isp_prt(isp, ISP_LOGDEBUG0, "Request Queue Overflow"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); @@ -3183,7 +3183,7 @@ isp_start(XS_T *xs) isp_put_request(isp, reqp, qep); ISP_ADD_REQUEST(isp, nxti); isp->isp_sendmarker &= ~(1 << i); - if (isp_getrqentry(isp, &nxti, &optr, (void **) &qep)) { + if (isp_getrqentry(isp, &nxti, &optr, (void *) &qep)) { isp_prt(isp, ISP_LOGDEBUG0, "Request Queue Overflow+"); XS_SETERR(xs, HBA_BOTCH); diff --git a/sys/dev/disk/isp/isp_freebsd.c b/sys/dev/disk/isp/isp_freebsd.c index 5271808707..bfdb45a216 100644 --- a/sys/dev/disk/isp/isp_freebsd.c +++ b/sys/dev/disk/isp/isp_freebsd.c @@ -1892,7 +1892,7 @@ isp_watchdog(void *arg) XS_CMD_C_WDOG(xs); callout_reset(&xs->ccb_h.timeout_ch, hz, isp_watchdog, xs); - if (isp_getrqentry(isp, &nxti, &optr, (void **) &qe)) { + if (isp_getrqentry(isp, &nxti, &optr, (void *) &qe)) { ISP_UNLOCK(isp); return; } diff --git a/sys/dev/disk/isp/isp_pci.c b/sys/dev/disk/isp/isp_pci.c index e8674dfbc1..40706ed49b 100644 --- a/sys/dev/disk/isp/isp_pci.c +++ b/sys/dev/disk/isp/isp_pci.c @@ -1073,7 +1073,7 @@ isp_pci_mbxdma(struct ispsoftc *isp) return (1); } - if (bus_dmamem_alloc(isp->isp_cdmat, (void **)&base, BUS_DMA_NOWAIT, + if (bus_dmamem_alloc(isp->isp_cdmat, (void *)&base, BUS_DMA_NOWAIT, &isp->isp_cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); diff --git a/sys/dev/disk/nata/ata-dma.c b/sys/dev/disk/nata/ata-dma.c index cab5043f45..796eec1d56 100644 --- a/sys/dev/disk/nata/ata-dma.c +++ b/sys/dev/disk/nata/ata-dma.c @@ -134,8 +134,8 @@ ata_dmaalloc(device_t dev) 0, &ch->dma->work_tag)) goto error; - if (bus_dmamem_alloc(ch->dma->work_tag, (void **)&ch->dma->work, 0, - &ch->dma->work_map)) + if (bus_dmamem_alloc(ch->dma->work_tag, (void *)&ch->dma->work, 0, + (void *)&ch->dma->work_map)) goto error; if (bus_dmamap_load(ch->dma->work_tag, ch->dma->work_map,ch->dma->work, diff --git a/sys/dev/disk/nata/ata-raid.c b/sys/dev/disk/nata/ata-raid.c index 4ae5464d07..990750059e 100644 --- a/sys/dev/disk/nata/ata-raid.c +++ b/sys/dev/disk/nata/ata-raid.c @@ -1024,6 +1024,7 @@ ata_raid_create(struct ata_ioc_raid_config *config) device_t subdisk; int array, disk; int ctlr = 0, disk_size = 0, total_disks = 0; + device_t gpdev; for (array = 0; array < MAX_ARRAYS; array++) { if (!ata_raid_arrays[array]) @@ -1048,7 +1049,9 @@ ata_raid_create(struct ata_ioc_raid_config *config) } rdp->disks[disk].dev = device_get_parent(subdisk); - switch (pci_get_vendor(GRANDPARENT(rdp->disks[disk].dev))) { + gpdev = GRANDPARENT(rdp->disks[disk].dev); + + switch (pci_get_vendor(gpdev)) { case ATA_HIGHPOINT_ID: /* * we need some way to decide if it should be v2 or v3 @@ -1393,10 +1396,16 @@ ata_raid_read_metadata(device_t subdisk) { devclass_t pci_devclass = devclass_find("pci"); devclass_t devclass=device_get_devclass(GRANDPARENT(GRANDPARENT(subdisk))); + device_t gpdev; + uint16_t vendor; /* prioritize vendor native metadata layout if possible */ if (devclass == pci_devclass) { - switch (pci_get_vendor(GRANDPARENT(device_get_parent(subdisk)))) { + gpdev = device_get_parent(subdisk); + gpdev = GRANDPARENT(gpdev); + vendor = pci_get_vendor(gpdev); + + switch (vendor) { case ATA_HIGHPOINT_ID: if (ata_raid_hptv3_read_meta(subdisk, ata_raid_arrays)) return 0; diff --git a/sys/dev/netif/an/if_an.c b/sys/dev/netif/an/if_an.c index c2ff0bd042..c1d3942fee 100644 --- a/sys/dev/netif/an/if_an.c +++ b/sys/dev/netif/an/if_an.c @@ -460,7 +460,7 @@ an_dma_malloc(struct an_softc *sc, bus_size_t size, struct an_dma_alloc *dma, if (r != 0) goto fail_0; - r = bus_dmamem_alloc(sc->an_dtag, (void**) &dma->an_dma_vaddr, + r = bus_dmamem_alloc(sc->an_dtag, (void*)&dma->an_dma_vaddr, BUS_DMA_WAITOK, &dma->an_dma_map); if (r != 0) goto fail_1; @@ -585,10 +585,10 @@ an_init_mpi350_desc(struct an_softc *sc) an_rx_desc.an_phys = sc->an_rx_buffer[desc].an_dma_paddr; for (i = 0; i < sizeof(an_rx_desc) / 4; i++) - CSR_MEM_AUX_WRITE_4(sc, AN_RX_DESC_OFFSET + CSR_MEM_AUX_WRITE_4(sc, AN_RX_DESC_OFFSET + (desc * sizeof(an_rx_desc)) + (i * 4), - ((u_int32_t*)&an_rx_desc)[i]); + ((u_int32_t*)(void *)&an_rx_desc)[i]); } /* @@ -618,7 +618,7 @@ an_init_mpi350_desc(struct an_softc *sc) CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET + (desc * sizeof(an_tx_desc)) + (i * 4), - ((u_int32_t*)&an_tx_desc)[i]); + ((u_int32_t*)(void *)&an_tx_desc)[i]); } /* @@ -644,7 +644,7 @@ an_init_mpi350_desc(struct an_softc *sc) for (i = 0; i < sizeof(an_rid_desc) / 4; i++) CSR_MEM_AUX_WRITE_4(sc, AN_HOST_DESC_OFFSET + i * 4, - ((u_int32_t*)&an_rid_desc)[i]); + ((u_int32_t*)(void *)&an_rid_desc)[i]); return(0); } @@ -965,7 +965,7 @@ an_rxeof(struct an_softc *sc) } else { /* MPI-350 */ for (count = 0; count < AN_MAX_RX_DESC; count++){ for (i = 0; i < sizeof(an_rx_desc) / 4; i++) - ((u_int32_t*)&an_rx_desc)[i] + ((u_int32_t*)(void *)&an_rx_desc)[i] = CSR_MEM_AUX_READ_4(sc, AN_RX_DESC_OFFSET + (count * sizeof(an_rx_desc)) @@ -1033,7 +1033,7 @@ an_rxeof(struct an_softc *sc) AN_RX_DESC_OFFSET + (count * sizeof(an_rx_desc)) + (i * 4), - ((u_int32_t*)&an_rx_desc)[i]); + ((u_int32_t*)(void *)&an_rx_desc)[i]); } else { if_printf(ifp, "Didn't get valid RX packet " @@ -1362,7 +1362,7 @@ an_read_record(struct an_softc *sc, struct an_ltv_gen *ltv) for (i = 0; i < sizeof(an_rid_desc) / 4; i++) CSR_MEM_AUX_WRITE_4(sc, AN_HOST_DESC_OFFSET + i * 4, - ((u_int32_t*)&an_rid_desc)[i]); + ((u_int32_t *)(void *)&an_rid_desc)[i]); if (an_cmd_struct(sc, &cmd, &reply) || reply.an_status & AN_CMD_QUAL_MASK) { @@ -1470,7 +1470,7 @@ an_write_record(struct an_softc *sc, struct an_ltv_gen *ltv) for (i = 0; i < sizeof(an_rid_desc) / 4; i++) CSR_MEM_AUX_WRITE_4(sc, AN_HOST_DESC_OFFSET + i * 4, - ((u_int32_t*)&an_rid_desc)[i]); + ((u_int32_t *)(void *)&an_rid_desc)[i]); if ((i = an_cmd_struct(sc, &cmd, &reply))) { if_printf(&sc->arpcom.ac_if, @@ -1861,7 +1861,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->an_sigitems) / 2) + 1; } else #endif - if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { + if (an_read_record(sc, (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -1912,7 +1912,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) if (ireq->i_val == -1) { sc->areq.an_type = AN_RID_STATUS; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -1921,7 +1921,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) } else if (ireq->i_val >= 0) { sc->areq.an_type = AN_RID_SSIDLIST; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -1958,7 +1958,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_len = sizeof(sc->areq); sc->areq.an_type = AN_RID_SSIDLIST; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -1975,7 +1975,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_WEP: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2005,7 +2005,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_type = AN_RID_WEP_TEMP; for (i = 0; i < 5; i++) { if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2039,7 +2039,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_type = AN_RID_WEP_TEMP; for (i = 0; i < 5; i++) { if (an_read_record(sc, - (struct an_ltv_gen *) &sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2054,7 +2054,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_type = AN_RID_WEP_PERM; key->kindex = 0xffff; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2067,7 +2067,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_len = sizeof(struct an_ltv_genconfig); sc->areq.an_type = AN_RID_GENCONFIG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2077,7 +2077,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_AUTHMODE: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2096,7 +2096,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_STATIONNAME: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2110,7 +2110,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_CHANNEL: sc->areq.an_type = AN_RID_STATUS; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2119,7 +2119,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_POWERSAVE: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2137,7 +2137,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) case IEEE80211_IOC_POWERSAVESLEEP: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2159,7 +2159,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) ireq->i_type != IEEE80211_IOC_WEPTXKEY) { sc->areq.an_type = AN_RID_GENCONFIG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2169,7 +2169,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_len = sizeof(sc->areq); sc->areq.an_type = AN_RID_SSIDLIST; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2261,7 +2261,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) sc->areq.an_len = sizeof(struct an_ltv_genconfig); sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, - (struct an_ltv_gen *)&sc->areq)) { + (struct an_ltv_gen *)(void *)&sc->areq)) { error = EINVAL; break; } @@ -2618,7 +2618,7 @@ an_start(struct ifnet *ifp) /* zero for now */ + (0 * sizeof(an_tx_desc)) + (i * 4), - ((u_int32_t*)&an_tx_desc)[i]); + ((u_int32_t*)(void *)&an_tx_desc)[i]); } BPF_MTAP(ifp, m0); @@ -3082,7 +3082,7 @@ readrids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) sc->areq.an_len = AN_MAX_DATALEN; sc->areq.an_type = rid; - an_read_record(sc, (struct an_ltv_gen *)&sc->areq); + an_read_record(sc, (struct an_ltv_gen *)(void *)&sc->areq); l_ioctl->len = sc->areq.an_len - 4; /* just data */ @@ -3142,7 +3142,7 @@ writerids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) sc->areq.an_len = AN_MAX_DATALEN; sc->areq.an_type = rid; - an_read_record(sc, (struct an_ltv_gen *)&sc->areq); + an_read_record(sc, (struct an_ltv_gen *)(void *)&sc->areq); l_ioctl->len = sc->areq.an_len - 4; /* just data */ /* the data contains the length at first */ @@ -3184,7 +3184,7 @@ writerids(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) l_ioctl->len); an_cmd(sc, AN_CMD_DISABLE, 0); - an_write_record(sc, (struct an_ltv_gen *)&sc->areq); + an_write_record(sc, (struct an_ltv_gen *)(void *)&sc->areq); an_cmd(sc, AN_CMD_ENABLE, 0); return 0; } @@ -3408,12 +3408,13 @@ flashputbuf(struct ifnet *ifp) CSR_WRITE_2(sc, AN_AUX_OFFSET, 0); for (nwords = 0; nwords != FLASH_SIZE / 2; nwords++) { - CSR_WRITE_2(sc, AN_AUX_DATA, bufp[nwords] & 0xffff); + CSR_WRITE_2(sc, AN_AUX_DATA, + ((u_int16_t *)(void *)bufp)[nwords] & 0xffff); } } else { for (nwords = 0; nwords != FLASH_SIZE / 4; nwords++) { CSR_MEM_AUX_WRITE_4(sc, 0x8000, - ((u_int32_t *)bufp)[nwords] & 0xffff); + ((u_int32_t *)(void *)bufp)[nwords] & 0xffff); } } @@ -3474,7 +3475,7 @@ flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) break; case AIROFLSHGCHR: /* Get char from aux */ copyin(l_ioctl->data, &sc->areq, l_ioctl->len); - z = *(int *)&sc->areq; + z = *(int *)(void *)&sc->areq; if ((status = flashgchar(ifp, z, 8000)) == 1) return 0; else @@ -3482,7 +3483,7 @@ flashcard(struct ifnet *ifp, struct aironet_ioctl *l_ioctl) break; case AIROFLSHPCHR: /* Send char to card. */ copyin(l_ioctl->data, &sc->areq, l_ioctl->len); - z = *(int *)&sc->areq; + z = *(int *)(void *)&sc->areq; if ((status = flashpchar(ifp, z, 8000)) == -1) return -EIO; else diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index 8945d92863..ccd06b50a2 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -767,7 +767,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_JUMBO_RX_RING_SZ, &sc->bge_cdata.bge_rx_jumbo_ring_tag, &sc->bge_cdata.bge_rx_jumbo_ring_map, - (void **)&sc->bge_ldata.bge_rx_jumbo_ring, + (void *)&sc->bge_ldata.bge_rx_jumbo_ring, &sc->bge_ldata.bge_rx_jumbo_ring_paddr); if (error) { if_printf(ifp, "could not create jumbo RX ring\n"); @@ -3506,7 +3506,7 @@ bge_dma_alloc(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_STD_RX_RING_SZ, &sc->bge_cdata.bge_rx_std_ring_tag, &sc->bge_cdata.bge_rx_std_ring_map, - (void **)&sc->bge_ldata.bge_rx_std_ring, + (void *)&sc->bge_ldata.bge_rx_std_ring, &sc->bge_ldata.bge_rx_std_ring_paddr); if (error) { if_printf(ifp, "could not create std RX ring\n"); @@ -3530,7 +3530,7 @@ bge_dma_alloc(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_RX_RTN_RING_SZ(sc), &sc->bge_cdata.bge_rx_return_ring_tag, &sc->bge_cdata.bge_rx_return_ring_map, - (void **)&sc->bge_ldata.bge_rx_return_ring, + (void *)&sc->bge_ldata.bge_rx_return_ring, &sc->bge_ldata.bge_rx_return_ring_paddr); if (error) { if_printf(ifp, "could not create RX ret ring\n"); @@ -3543,7 +3543,7 @@ bge_dma_alloc(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_TX_RING_SZ, &sc->bge_cdata.bge_tx_ring_tag, &sc->bge_cdata.bge_tx_ring_map, - (void **)&sc->bge_ldata.bge_tx_ring, + (void *)&sc->bge_ldata.bge_tx_ring, &sc->bge_ldata.bge_tx_ring_paddr); if (error) { if_printf(ifp, "could not create TX ring\n"); @@ -3556,7 +3556,7 @@ bge_dma_alloc(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_STATUS_BLK_SZ, &sc->bge_cdata.bge_status_tag, &sc->bge_cdata.bge_status_map, - (void **)&sc->bge_ldata.bge_status_block, + (void *)&sc->bge_ldata.bge_status_block, &sc->bge_ldata.bge_status_block_paddr); if (error) { if_printf(ifp, "could not create status block\n"); @@ -3569,7 +3569,7 @@ bge_dma_alloc(struct bge_softc *sc) error = bge_dma_block_alloc(sc, BGE_STATS_SZ, &sc->bge_cdata.bge_stats_tag, &sc->bge_cdata.bge_stats_map, - (void **)&sc->bge_ldata.bge_stats, + (void *)&sc->bge_ldata.bge_stats, &sc->bge_ldata.bge_stats_paddr); if (error) { if_printf(ifp, "could not create stats block\n"); diff --git a/sys/dev/netif/msk/if_msk.c b/sys/dev/netif/msk/if_msk.c index 91b4459314..e466ce798a 100644 --- a/sys/dev/netif/msk/if_msk.c +++ b/sys/dev/netif/msk/if_msk.c @@ -1840,7 +1840,7 @@ msk_txrx_dma_alloc(struct msk_if_softc *sc_if) /* Create DMA stuffs for Tx ring. */ error = msk_dmamem_create(sc_if->msk_if_dev, MSK_TX_RING_SZ, &sc_if->msk_cdata.msk_tx_ring_tag, - (void **)&sc_if->msk_rdata.msk_tx_ring, + (void *)&sc_if->msk_rdata.msk_tx_ring, &sc_if->msk_rdata.msk_tx_ring_paddr, &sc_if->msk_cdata.msk_tx_ring_map); if (error) { @@ -1852,7 +1852,7 @@ msk_txrx_dma_alloc(struct msk_if_softc *sc_if) /* Create DMA stuffs for Rx ring. */ error = msk_dmamem_create(sc_if->msk_if_dev, MSK_RX_RING_SZ, &sc_if->msk_cdata.msk_rx_ring_tag, - (void **)&sc_if->msk_rdata.msk_rx_ring, + (void *)&sc_if->msk_rdata.msk_rx_ring, &sc_if->msk_rdata.msk_rx_ring_paddr, &sc_if->msk_cdata.msk_rx_ring_map); if (error) { diff --git a/sys/dev/netif/nfe/if_nfe.c b/sys/dev/netif/nfe/if_nfe.c index 78fa3ee344..e095181283 100644 --- a/sys/dev/netif/nfe/if_nfe.c +++ b/sys/dev/netif/nfe/if_nfe.c @@ -1641,10 +1641,10 @@ nfe_alloc_rx_ring(struct nfe_softc *sc, struct nfe_rx_ring *ring) void **desc; if (sc->sc_caps & NFE_40BIT_ADDR) { - desc = (void **)&ring->desc64; + desc = (void *)&ring->desc64; descsize = sizeof(struct nfe_desc64); } else { - desc = (void **)&ring->desc32; + desc = (void *)&ring->desc32; descsize = sizeof(struct nfe_desc32); } @@ -1929,10 +1929,10 @@ nfe_alloc_tx_ring(struct nfe_softc *sc, struct nfe_tx_ring *ring) void **desc; if (sc->sc_caps & NFE_40BIT_ADDR) { - desc = (void **)&ring->desc64; + desc = (void *)&ring->desc64; descsize = sizeof(struct nfe_desc64); } else { - desc = (void **)&ring->desc32; + desc = (void *)&ring->desc32; descsize = sizeof(struct nfe_desc32); } diff --git a/sys/dev/pccard/pccbb/pccbb.c b/sys/dev/pccard/pccbb/pccbb.c index cb0d2d4e15..cbe7e8626f 100644 --- a/sys/dev/pccard/pccbb/pccbb.c +++ b/sys/dev/pccard/pccbb/pccbb.c @@ -132,19 +132,19 @@ SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); /* There's no way to say TUNEABLE_LONG to get the right types */ u_long cbb_start_mem = CBB_START_MEM; -TUNABLE_INT("hw.cbb.start_memory", (int *)&cbb_start_mem); +TUNABLE_ULONG("hw.cbb.start_memory", &cbb_start_mem); SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_memory, CTLFLAG_RW, &cbb_start_mem, CBB_START_MEM, "Starting address for memory allocations"); u_long cbb_start_16_io = CBB_START_16_IO; -TUNABLE_INT("hw.cbb.start_16_io", (int *)&cbb_start_16_io); +TUNABLE_ULONG("hw.cbb.start_16_io", &cbb_start_16_io); SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_16_io, CTLFLAG_RW, &cbb_start_16_io, CBB_START_16_IO, "Starting ioport for 16-bit cards"); u_long cbb_start_32_io = CBB_START_32_IO; -TUNABLE_INT("hw.cbb.start_32_io", (int *)&cbb_start_32_io); +TUNABLE_ULONG("hw.cbb.start_32_io", &cbb_start_32_io); SYSCTL_ULONG(_hw_cbb, OID_AUTO, start_32_io, CTLFLAG_RW, &cbb_start_32_io, CBB_START_32_IO, "Starting ioport for 32-bit cards"); diff --git a/sys/dev/raid/amr/amr_pci.c b/sys/dev/raid/amr/amr_pci.c index 209cb77c7a..76c060da92 100644 --- a/sys/dev/raid/amr/amr_pci.c +++ b/sys/dev/raid/amr/amr_pci.c @@ -525,7 +525,7 @@ amr_sglist_map(struct amr_softc *sc) * avoid this with the tag setup, but that does't seem to work. */ retry: - error = bus_dmamem_alloc(sc->amr_sg_dmat, (void **)&sc->amr_sgtable, BUS_DMA_NOWAIT, &sc->amr_sg_dmamap); + error = bus_dmamem_alloc(sc->amr_sg_dmat, (void *)&sc->amr_sgtable, BUS_DMA_NOWAIT, &sc->amr_sg_dmamap); if (error) { device_printf(sc->amr_dev, "can't allocate s/g table\n"); return(ENOMEM); @@ -585,7 +585,7 @@ amr_setup_mbox(struct amr_softc *sc) * Allocate the mailbox structure and permanently map it into * controller-visible space. */ - error = bus_dmamem_alloc(sc->amr_mailbox_dmat, (void **)&p, BUS_DMA_NOWAIT, + error = bus_dmamem_alloc(sc->amr_mailbox_dmat, (void *)&p, BUS_DMA_NOWAIT, &sc->amr_mailbox_dmamap); if (error) { device_printf(sc->amr_dev, "can't allocate mailbox memory\n"); diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c index 9afc43423c..f3bc58437f 100644 --- a/sys/dev/raid/ciss/ciss.c +++ b/sys/dev/raid/ciss/ciss.c @@ -735,7 +735,7 @@ ciss_flush_adapter(struct ciss_softc *sc) */ cbfc = kmalloc(sizeof(*cbfc), CISS_MALLOC_CLASS, M_INTWAIT | M_ZERO); if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_FLUSH_CACHE, - (void **)&cbfc, sizeof(*cbfc))) != 0) + (void *)&cbfc, sizeof(*cbfc))) != 0) goto out; /* @@ -861,7 +861,7 @@ ciss_identify_adapter(struct ciss_softc *sc) * Get a request, allocate storage for the adapter data. */ if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_ID_CTLR, - (void **)&sc->ciss_id, + (void *)&sc->ciss_id, sizeof(*sc->ciss_id))) != 0) goto out; @@ -1341,7 +1341,7 @@ ciss_identify_logical(struct ciss_softc *sc, struct ciss_ldrive *ld) * Build a BMIC request to fetch the drive ID. */ if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_ID_LDRIVE, - (void **)&ld->cl_ldrive, + (void *)&ld->cl_ldrive, sizeof(*ld->cl_ldrive))) != 0) goto out; cc = CISS_FIND_COMMAND(cr); @@ -1437,7 +1437,7 @@ ciss_get_ldrive_status(struct ciss_softc *sc, struct ciss_ldrive *ld) * Build a CISS BMIC command to get the logical drive status. */ if ((error = ciss_get_bmic_request(sc, &cr, CISS_BMIC_ID_LSTATUS, - (void **)&ld->cl_lstatus, + (void *)&ld->cl_lstatus, sizeof(*ld->cl_lstatus))) != 0) goto out; cc = CISS_FIND_COMMAND(cr); diff --git a/sys/dev/raid/dpt/dpt_scsi.c b/sys/dev/raid/dpt/dpt_scsi.c index faf1245cf6..fb49d421dd 100644 --- a/sys/dev/raid/dpt/dpt_scsi.c +++ b/sys/dev/raid/dpt/dpt_scsi.c @@ -303,7 +303,7 @@ dptallocsgmap(struct dpt_softc *dpt) sg_map = kmalloc(sizeof(*sg_map), M_DEVBUF, M_INTWAIT); /* Allocate S/G space for the next batch of CCBS */ - if (bus_dmamem_alloc(dpt->sg_dmat, (void **)&sg_map->sg_vaddr, + if (bus_dmamem_alloc(dpt->sg_dmat, (void *)&sg_map->sg_vaddr, BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { kfree(sg_map, M_DEVBUF); return (NULL); @@ -1403,7 +1403,7 @@ dpt_init(struct dpt_softc *dpt) dpt->init_level++; /* Allocation for our ccbs and interrupt status packet */ - if (bus_dmamem_alloc(dpt->dccb_dmat, (void **)&dpt->dpt_dccbs, + if (bus_dmamem_alloc(dpt->dccb_dmat, (void *)&dpt->dpt_dccbs, BUS_DMA_NOWAIT, &dpt->dccb_dmamap) != 0) { kprintf("dpt: bus_dmamem_alloc(dpt->dccb_dmat,...) failed\n"); goto error_exit; diff --git a/sys/dev/raid/ida/ida.c b/sys/dev/raid/ida/ida.c index 83c5de771e..beb129de1f 100644 --- a/sys/dev/raid/ida/ida.c +++ b/sys/dev/raid/ida/ida.c @@ -224,7 +224,7 @@ ida_init(struct ida_softc *ida) /* Allocation of hardware QCBs */ /* XXX allocation is rounded to hardware page size */ error = bus_dmamem_alloc(ida->hwqcb_dmat, - (void **)&ida->hwqcbs, BUS_DMA_NOWAIT, &ida->hwqcb_dmamap); + (void *)&ida->hwqcbs, BUS_DMA_NOWAIT, &ida->hwqcb_dmamap); if (error) return (ENOMEM); diff --git a/sys/dev/raid/iir/iir.c b/sys/dev/raid/iir/iir.c index 2e66965258..322deacadb 100644 --- a/sys/dev/raid/iir/iir.c +++ b/sys/dev/raid/iir/iir.c @@ -236,7 +236,7 @@ iir_init(struct gdt_softc *gdt) gdt->sc_init_level++; /* Allocation for our ccb scratch area */ - if (bus_dmamem_alloc(gdt->sc_gcscratch_dmat, (void **)&gdt->sc_gcscratch, + if (bus_dmamem_alloc(gdt->sc_gcscratch_dmat, (void *)&gdt->sc_gcscratch, BUS_DMA_NOWAIT, &gdt->sc_gcscratch_dmamap) != 0) { kprintf("iir%d: bus_dmamem_alloc(...,&gdt->sc_gcscratch,...) failed\n", gdt->sc_hanum); diff --git a/sys/dev/raid/mlx/mlx.c b/sys/dev/raid/mlx/mlx.c index 093f477f78..d9af989047 100644 --- a/sys/dev/raid/mlx/mlx.c +++ b/sys/dev/raid/mlx/mlx.c @@ -257,7 +257,7 @@ mlx_sglist_map(struct mlx_softc *sc) * contiguous slab. We may need to switch to a more complex arrangement where * we allocate in smaller chunks and keep a lookup table from slot to bus address. */ - error = bus_dmamem_alloc(sc->mlx_sg_dmat, (void **)&sc->mlx_sgtable, BUS_DMA_NOWAIT, &sc->mlx_sg_dmamap); + error = bus_dmamem_alloc(sc->mlx_sg_dmat, (void *)&sc->mlx_sgtable, BUS_DMA_NOWAIT, &sc->mlx_sg_dmamap); if (error) { device_printf(sc->mlx_dev, "can't allocate s/g table\n"); return(ENOMEM); -- 2.41.0