From 62c54088ae4b67c180bdd66a5680e1702640485a Mon Sep 17 00:00:00 2001 From: krw Date: Tue, 12 Dec 2017 12:33:36 +0000 Subject: [PATCH] Nuke some forward-only struct's and functions and functions thereby made empty. Found by new ctfconv(1) feature and validated by clang. ok mpi@ --- sys/dev/ic/aic79xx.c | 28 +--------------------------- sys/dev/ic/aic79xx.h | 12 +----------- sys/dev/ic/aic79xx_openbsd.c | 26 +------------------------- sys/dev/ic/aic79xx_openbsd.h | 17 ++--------------- sys/dev/ic/aic7xxx.c | 17 ++--------------- sys/dev/ic/aic7xxx_openbsd.c | 22 +--------------------- sys/dev/ic/aic7xxx_openbsd.h | 32 +------------------------------- sys/dev/ic/aic7xxxvar.h | 12 ++---------- 8 files changed, 11 insertions(+), 155 deletions(-) diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c index 6bda2e1d317..c6b3c928aad 100644 --- a/sys/dev/ic/aic79xx.c +++ b/sys/dev/ic/aic79xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx.c,v 1.62 2016/08/31 12:59:59 tom Exp $ */ +/* $OpenBSD: aic79xx.c,v 1.63 2017/12/12 12:33:36 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -5268,11 +5268,6 @@ ahd_alloc(void *platform_arg, char *name) ahd->int_coalescing_stop_threshold = AHD_INT_COALESCING_STOP_THRESHOLD_DEFAULT; - if (ahd_platform_alloc(ahd, platform_arg) != 0) { - free(ahd->seep_config, M_DEVBUF, 0); - return (NULL); - } - #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { printf("%s: scb size = 0x%x, hscb size = 0x%x\n", @@ -5392,7 +5387,6 @@ ahd_free(struct ahd_softc *ahd) break; } - ahd_platform_free(ahd); ahd_fini_scbdata(ahd); for (i = 0; i < AHD_NUM_TARGETS; i++) { struct ahd_tmode_tstate *tstate; @@ -5949,7 +5943,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd) scb_data->scbs_left -= newcount; scb_data->sgs_left -= newcount; for (i = 0; i < newcount; i++) { - struct scb_platform_data *pdata = NULL; int error; next_scb = (struct scb *)malloc(sizeof(*next_scb), @@ -5957,14 +5950,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd) if (next_scb == NULL) break; - if (sizeof(*pdata) > 0) { - pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT); - if (pdata == NULL) { - free(next_scb, M_DEVBUF, 0); - break; - } - } - next_scb->platform_data = pdata; next_scb->hscb_map = hscb_map; next_scb->sg_map = sg_map; next_scb->sense_map = sense_map; @@ -5996,7 +5981,6 @@ ahd_alloc_scbs(struct ahd_softc *ahd) if (error != 0) { free(next_scb, M_DEVBUF, 0); - free(pdata, M_DEVBUF, 0); break; } next_scb->hscb->tag = aic_htole16(scb_data->numscbs); @@ -6134,12 +6118,6 @@ ahd_init(struct ahd_softc *ahd) if ((ahd->flags & AHD_INITIATORROLE) == 0) ahd->flags &= ~AHD_RESET_BUS_A; - /* - * Before committing these settings to the chip, give - * the OSM one last chance to modify our configuration. - */ - ahd_platform_init(ahd); - /* Bring up the chip. */ ahd_chip_init(ahd); @@ -6879,7 +6857,6 @@ ahd_pause_and_flushwork(struct ahd_softc *ahd) ahd_flush_qoutfifo(ahd); - ahd_platform_flushwork(ahd); ahd->flags &= ~AHD_ALL_INTERRUPTS; } @@ -7014,8 +6991,6 @@ ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb) ahd_search_qinfifo(ahd, target, channel, lun, /*tag*/SCB_LIST_NULL, ROLE_UNKNOWN, CAM_REQUEUE_REQ, SEARCH_COMPLETE); - - ahd_platform_freeze_devq(ahd, scb); } void @@ -7595,7 +7570,6 @@ ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel, } } ahd_restore_modes(ahd, saved_modes); - ahd_platform_abort_scbs(ahd, target, channel, lun, tag, role, status); ahd->flags |= AHD_UPDATE_PEND_CMDS; return found; } diff --git a/sys/dev/ic/aic79xx.h b/sys/dev/ic/aic79xx.h index 2db84c48e79..66a6664d459 100644 --- a/sys/dev/ic/aic79xx.h +++ b/sys/dev/ic/aic79xx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx.h,v 1.26 2016/08/17 01:16:11 krw Exp $ */ +/* $OpenBSD: aic79xx.h,v 1.27 2017/12/12 12:33:36 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -81,10 +81,6 @@ #include -/************************* Forward Declarations *******************************/ -struct ahd_platform_data; -struct scb_platform_data; - /****************************** Useful Macros *********************************/ #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) @@ -625,7 +621,6 @@ struct scb { struct ahd_softc *ahd_softc; scb_flag flags; bus_dmamap_t dmamap; - struct scb_platform_data *platform_data; struct map_node *hscb_map; struct map_node *sg_map; struct map_node *sense_map; @@ -1088,11 +1083,6 @@ struct ahd_softc { ahd_mode saved_dst_mode; ahd_mode saved_src_mode; - /* - * Platform specific data. - */ - struct ahd_platform_data *platform_data; - /* * Platform specific device information. */ diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index 56879844fef..58ec444d579 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.45 2016/08/17 01:16:11 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.46 2017/12/12 12:33:36 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -550,26 +550,6 @@ ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, tstate->tagenable &= ~devinfo->target_mask; } -int -ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg) -{ - if (sizeof(struct ahd_platform_data) > 0) { - ahd->platform_data = malloc(sizeof(struct ahd_platform_data), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (ahd->platform_data == NULL) - return (ENOMEM); - } - - return (0); -} - -void -ahd_platform_free(struct ahd_softc *ahd) -{ - if (sizeof(struct ahd_platform_data) > 0) - free(ahd->platform_data, M_DEVBUF, 0); -} - int ahd_softc_comp(struct ahd_softc *lahd, struct ahd_softc *rahd) { @@ -731,7 +711,3 @@ ahd_platform_dump_card_state(struct ahd_softc *ahd) ahd->features, ahd->flags, ahd->chip, ahd->bugs); } -void -ahd_platform_flushwork(struct ahd_softc *ahd) -{ -} diff --git a/sys/dev/ic/aic79xx_openbsd.h b/sys/dev/ic/aic79xx_openbsd.h index 0601b794d56..f7e0624899f 100644 --- a/sys/dev/ic/aic79xx_openbsd.h +++ b/sys/dev/ic/aic79xx_openbsd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.h,v 1.19 2015/07/17 21:42:49 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.h,v 1.20 2017/12/12 12:33:36 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -136,13 +136,6 @@ typedef struct pci_attach_args * ahd_dev_softc_t; /* This driver supports target mode */ // #define AHD_TARGET_MODE 1 -/************************** Softc/SCB Platform Data ***************************/ -struct ahd_platform_data { -}; - -struct scb_platform_data { -}; - /************************** Timer DataStructures ******************************/ typedef struct timeout aic_timer_t; @@ -232,8 +225,6 @@ void ahd_flush_device_writes(struct ahd_softc *); #define aic_freeze_simq(ahd) #define aic_release_simq(ahd) #define aic_freeze_scb(scb) -#define ahd_platform_freeze_devq(ahd, scb) -#define ahd_platform_abort_scbs(ahd, target, channel, lun, tag, role, status) void aic_platform_scb_free(struct ahd_softc *, struct scb *); @@ -268,17 +259,13 @@ void ahd_platform_set_tags(struct ahd_softc *, struct ahd_devinfo *, ahd_queue_alg); /************************* Initialization/Teardown ****************************/ -int ahd_platform_alloc(struct ahd_softc *, void *); -void ahd_platform_free(struct ahd_softc *); int ahd_attach(struct ahd_softc *); int ahd_softc_comp(struct ahd_softc *lahd, struct ahd_softc *rahd); int ahd_detach(struct device *, int); -#define ahd_platform_init(ahd) - /****************************** Interrupts ************************************/ int ahd_platform_intr(void *); -void ahd_platform_flushwork(struct ahd_softc *ahd); + /************************ Misc Function Declarations **************************/ void ahd_done(struct ahd_softc *, struct scb *); void ahd_send_async(struct ahd_softc *, char /*channel*/, diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c index 8c5044ff6d3..7602339a9ed 100644 --- a/sys/dev/ic/aic7xxx.c +++ b/sys/dev/ic/aic7xxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx.c,v 1.92 2016/08/17 01:17:54 krw Exp $ */ +/* $OpenBSD: aic7xxx.c,v 1.93 2017/12/12 12:33:36 krw Exp $ */ /* $NetBSD: aic7xxx.c,v 1.108 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -40,7 +40,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: aic7xxx.c,v 1.92 2016/08/17 01:17:54 krw Exp $ + * $Id: aic7xxx.c,v 1.93 2017/12/12 12:33:36 krw Exp $ */ /* * Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003 @@ -3982,7 +3982,6 @@ ahc_free(struct ahc_softc *ahc) break; } - ahc_platform_free(ahc); ahc_fini_scbdata(ahc); for (i = 0; i < AHC_NUM_TARGETS; i++) { struct ahc_tmode_tstate *tstate; @@ -4396,17 +4395,8 @@ ahc_alloc_scbs(struct ahc_softc *ahc) newcount = (PAGE_SIZE / (AHC_NSEG * sizeof(struct ahc_dma_seg))); newcount = MIN(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs)); for (i = 0; i < newcount; i++) { - struct scb_platform_data *pdata = NULL; int error; - if (sizeof(*pdata) > 0) { - pdata = malloc(sizeof(*pdata), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (pdata == NULL) - break; - } - - next_scb->platform_data = pdata; next_scb->sg_map = sg_map; next_scb->sg_list = segs; /* @@ -5100,8 +5090,6 @@ ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb) ahc_search_qinfifo(ahc, target, channel, lun, /*tag*/SCB_LIST_NULL, ROLE_UNKNOWN, CAM_REQUEUE_REQ, SEARCH_COMPLETE); - - ahc_platform_freeze_devq(ahc, scb); } void @@ -5755,7 +5743,6 @@ ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, } } ahc_outb(ahc, SCBPTR, active_scb); - ahc_platform_abort_scbs(ahc, target, channel, lun, tag, role, status); ahc_release_untagged_queues(ahc); return found; } diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index f68f7ac3fb2..147a44035fb 100644 --- a/sys/dev/ic/aic7xxx_openbsd.c +++ b/sys/dev/ic/aic7xxx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.c,v 1.55 2016/08/17 01:17:54 krw Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.56 2017/12/12 12:33:36 krw Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -637,26 +637,6 @@ ahc_platform_set_tags(struct ahc_softc *ahc, } } -int -ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg) -{ - if (sizeof(struct ahc_platform_data) > 0) { - ahc->platform_data = malloc(sizeof(struct ahc_platform_data), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (ahc->platform_data == NULL) - return (ENOMEM); - } - - return (0); -} - -void -ahc_platform_free(struct ahc_softc *ahc) -{ - if (sizeof(struct ahc_platform_data) > 0) - free(ahc->platform_data, M_DEVBUF, 0); -} - int ahc_softc_comp(struct ahc_softc *lahc, struct ahc_softc *rahc) { diff --git a/sys/dev/ic/aic7xxx_openbsd.h b/sys/dev/ic/aic7xxx_openbsd.h index a9acc40feea..8b3f26afd05 100644 --- a/sys/dev/ic/aic7xxx_openbsd.h +++ b/sys/dev/ic/aic7xxx_openbsd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.h,v 1.26 2016/08/17 01:17:54 krw Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.h,v 1.27 2017/12/12 12:33:36 krw Exp $ */ /* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -128,13 +128,6 @@ typedef struct pci_attach_args * ahc_dev_softc_t; #include -/************************** Softc/SCB Platform Data ***************************/ -struct ahc_platform_data { -}; - -struct scb_platform_data { -}; - /* * Some ISA devices (e.g. on a VLB) can perform 32-bit DMA. This * flag is passed to bus_dmamap_create() to indicate that fact. @@ -216,9 +209,6 @@ static __inline int ahc_perform_autosense(struct scb *); static __inline uint32_t ahc_get_sense_bufsize(struct ahc_softc *, struct scb *); static __inline void ahc_freeze_scb(struct scb *); -static __inline void ahc_platform_freeze_devq(struct ahc_softc *, struct scb *); -static __inline int ahc_platform_abort_scbs(struct ahc_softc *, int, char, - int, u_int, role_t, uint32_t); static __inline void ahc_set_transaction_status(struct scb *scb, uint32_t status) @@ -300,19 +290,6 @@ ahc_freeze_scb(struct scb *scb) { } -static __inline void -ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb) -{ -} - -static __inline int -ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, - char channel, int lun, u_int tag, - role_t role, uint32_t status) -{ - return (0); -} - static __inline void ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb) { @@ -408,8 +385,6 @@ void ahc_notify_xfer_settings_change(struct ahc_softc *, void ahc_platform_set_tags(struct ahc_softc *, struct ahc_devinfo *, int); /************************* Initialization/Teardown ****************************/ -int ahc_platform_alloc(struct ahc_softc *, void *); -void ahc_platform_free(struct ahc_softc *); int ahc_map_int(struct ahc_softc *); int ahc_attach(struct ahc_softc *); int ahc_softc_comp(struct ahc_softc *, struct ahc_softc *); @@ -417,11 +392,6 @@ int ahc_detach(struct device *, int); /****************************** Interrupts ************************************/ int ahc_platform_intr(void *); -static __inline void ahc_platform_flushwork(struct ahc_softc *); -static __inline void -ahc_platform_flushwork(struct ahc_softc *ahc) -{ -} /************************ Misc Function Declarations **************************/ void ahc_done(struct ahc_softc *, struct scb *); diff --git a/sys/dev/ic/aic7xxxvar.h b/sys/dev/ic/aic7xxxvar.h index 4ab17f92d25..63e98b45576 100644 --- a/sys/dev/ic/aic7xxxvar.h +++ b/sys/dev/ic/aic7xxxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxxvar.h,v 1.30 2016/08/17 01:17:54 krw Exp $ */ +/* $OpenBSD: aic7xxxvar.h,v 1.31 2017/12/12 12:33:36 krw Exp $ */ /* * Core definitions and data structures shareable across OS platforms. * @@ -38,7 +38,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: aic7xxxvar.h,v 1.30 2016/08/17 01:17:54 krw Exp $ + * $Id: aic7xxxvar.h,v 1.31 2017/12/12 12:33:36 krw Exp $ * * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.h,v 1.50 2003/12/17 00:02:09 gibbs Exp $ */ @@ -56,8 +56,6 @@ #include /************************* Forward Declarations *******************************/ -struct ahc_platform_data; -struct scb_platform_data; struct seeprom_descriptor; /****************************** Useful Macros *********************************/ @@ -598,7 +596,6 @@ struct scb { struct ahc_softc *ahc_softc; scb_flag flags; bus_dmamap_t dmamap; - struct scb_platform_data *platform_data; struct sg_map_node *sg_map; struct ahc_dma_seg *sg_list; bus_addr_t sg_list_phys; @@ -982,11 +979,6 @@ struct ahc_softc { */ union ahc_bus_softc bus_softc; - /* - * Platform specific data. - */ - struct ahc_platform_data *platform_data; - /* * Platform specific device information. */ -- 2.20.1