svn commit: r355426 - in head/sys: dev/ahci dev/ata dev/mvs dev/siis net/altq powerpc/mpc85xx

John Baldwin jhb at FreeBSD.org
Thu Dec 5 18:47:31 UTC 2019


Author: jhb
Date: Thu Dec  5 18:47:29 2019
New Revision: 355426
URL: https://svnweb.freebsd.org/changeset/base/355426

Log:
  Use a void * argument to callout handlers instead of timeout_t casts.
  
  Reviewed by:	kib
  Differential Revision:	https://reviews.freebsd.org/D22684

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-all.h
  head/sys/dev/ata/ata-lowlevel.c
  head/sys/dev/mvs/mvs.c
  head/sys/dev/siis/siis.c
  head/sys/net/altq/altq_rmclass.c
  head/sys/powerpc/mpc85xx/fsl_sata.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/ahci/ahci.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -67,7 +67,7 @@ static void ahci_ch_intr_main(struct ahci_channel *ch,
 static void ahci_begin_transaction(struct ahci_channel *ch, union ccb *ccb);
 static void ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error);
 static void ahci_execute_transaction(struct ahci_slot *slot);
-static void ahci_timeout(struct ahci_slot *slot);
+static void ahci_timeout(void *arg);
 static void ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et);
 static int ahci_setup_fis(struct ahci_channel *ch, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag);
 static void ahci_dmainit(device_t dev);
@@ -1793,7 +1793,7 @@ ahci_execute_transaction(struct ahci_slot *slot)
 	}
 	/* Start command execution timeout */
 	callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout / 2,
-	    0, (timeout_t*)ahci_timeout, slot, 0);
+	    0, ahci_timeout, slot, 0);
 	return;
 }
 
@@ -1830,14 +1830,15 @@ ahci_rearm_timeout(struct ahci_channel *ch)
 			continue;
 		callout_reset_sbt(&slot->timeout,
     	    	    SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
-		    (timeout_t*)ahci_timeout, slot, 0);
+		    ahci_timeout, slot, 0);
 	}
 }
 
 /* Locked by callout mechanism. */
 static void
-ahci_timeout(struct ahci_slot *slot)
+ahci_timeout(void *arg)
 {
+	struct ahci_slot *slot = arg;
 	struct ahci_channel *ch = slot->ch;
 	device_t dev = ch->dev;
 	uint32_t sstatus;
@@ -1864,7 +1865,7 @@ ahci_timeout(struct ahci_slot *slot)
 
 		callout_reset_sbt(&slot->timeout,
 	    	    SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
-		    (timeout_t*)ahci_timeout, slot, 0);
+		    ahci_timeout, slot, 0);
 		return;
 	}
 

Modified: head/sys/dev/ata/ata-all.c
==============================================================================
--- head/sys/dev/ata/ata-all.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/ata/ata-all.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -702,10 +702,12 @@ ata_atapi(device_t dev, int target)
 }
 
 void
-ata_timeout(struct ata_request *request)
+ata_timeout(void *arg)
 {
+	struct ata_request *request;
 	struct ata_channel *ch;
 
+	request = arg;
 	ch = device_get_softc(request->parent);
 	//request->flags |= ATA_R_DEBUG;
 	ATA_DEBUG_RQ(request, "timeout");

Modified: head/sys/dev/ata/ata-all.h
==============================================================================
--- head/sys/dev/ata/ata-all.h	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/ata/ata-all.h	Thu Dec  5 18:47:29 2019	(r355426)
@@ -477,7 +477,7 @@ const char *ata_mode2str(int mode);
 void ata_setmode(device_t dev);
 void ata_print_cable(device_t dev, u_int8_t *who);
 int ata_atapi(device_t dev, int target);
-void ata_timeout(struct ata_request *);
+void ata_timeout(void *);
 
 /* ata-lowlevel.c: */
 void ata_generic_hw(device_t dev);

Modified: head/sys/dev/ata/ata-lowlevel.c
==============================================================================
--- head/sys/dev/ata/ata-lowlevel.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/ata/ata-lowlevel.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -237,7 +237,7 @@ begin_finished:
 
 begin_continue:
     callout_reset(&request->callout, request->timeout * hz,
-		  (timeout_t*)ata_timeout, request);
+		  ata_timeout, request);
     return ATA_OP_CONTINUES;
 }
 

Modified: head/sys/dev/mvs/mvs.c
==============================================================================
--- head/sys/dev/mvs/mvs.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/mvs/mvs.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -82,7 +82,7 @@ static void mvs_legacy_intr(device_t dev, int poll);
 static void mvs_crbq_intr(device_t dev);
 static void mvs_begin_transaction(device_t dev, union ccb *ccb);
 static void mvs_legacy_execute_transaction(struct mvs_slot *slot);
-static void mvs_timeout(struct mvs_slot *slot);
+static void mvs_timeout(void *arg);
 static void mvs_dmasetprd(void *arg,
 	bus_dma_segment_t *segs, int nsegs, int error);
 static void mvs_requeue_frozen(device_t dev);
@@ -1418,7 +1418,7 @@ mvs_legacy_execute_transaction(struct mvs_slot *slot)
 	}
 	/* Start command execution timeout */
 	callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
-	    (timeout_t*)mvs_timeout, slot, 0);
+	    mvs_timeout, slot, 0);
 }
 
 /* Must be called with channel locked. */
@@ -1532,7 +1532,7 @@ mvs_execute_transaction(struct mvs_slot *slot)
 	    ch->dma.workrq_bus + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx));
 	/* Start command execution timeout */
 	callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
-	    (timeout_t*)mvs_timeout, slot, 0);
+	    mvs_timeout, slot, 0);
 	return;
 }
 
@@ -1571,14 +1571,15 @@ mvs_rearm_timeout(device_t dev)
 			continue;
 		callout_reset_sbt(&slot->timeout,
 		    SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
-		    (timeout_t*)mvs_timeout, slot, 0);
+		    mvs_timeout, slot, 0);
 	}
 }
 
 /* Locked by callout mechanism. */
 static void
-mvs_timeout(struct mvs_slot *slot)
+mvs_timeout(void *arg)
 {
+	struct mvs_slot *slot = arg;
 	device_t dev = slot->dev;
 	struct mvs_channel *ch = device_get_softc(dev);
 

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/dev/siis/siis.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -72,7 +72,7 @@ static void siis_ch_led(void *priv, int onoff);
 static void siis_begin_transaction(device_t dev, union ccb *ccb);
 static void siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error);
 static void siis_execute_transaction(struct siis_slot *slot);
-static void siis_timeout(struct siis_slot *slot);
+static void siis_timeout(void *arg);
 static void siis_end_transaction(struct siis_slot *slot, enum siis_err_type et);
 static int siis_setup_fis(device_t dev, struct siis_cmd *ctp, union ccb *ccb, int tag);
 static void siis_dmainit(device_t dev);
@@ -1123,7 +1123,7 @@ siis_execute_transaction(struct siis_slot *slot)
 	ATA_OUTL(ch->r_mem, SIIS_P_CACTH(slot->slot), prb_bus >> 32);
 	/* Start command execution timeout */
 	callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
-	    (timeout_t*)siis_timeout, slot, 0);
+	    siis_timeout, slot, 0);
 	return;
 }
 
@@ -1166,14 +1166,15 @@ siis_rearm_timeout(device_t dev)
 			continue;
 		callout_reset_sbt(&slot->timeout,
 		    SBT_1MS * slot->ccb->ccb_h.timeout, 0,
-		    (timeout_t*)siis_timeout, slot, 0);
+		    siis_timeout, slot, 0);
 	}
 }
 
 /* Locked by callout mechanism. */
 static void
-siis_timeout(struct siis_slot *slot)
+siis_timeout(void *arg)
 {
+	struct siis_slot *slot = arg;
 	device_t dev = slot->dev;
 	struct siis_channel *ch = device_get_softc(dev);
 	union ccb *ccb = slot->ccb;

Modified: head/sys/net/altq/altq_rmclass.c
==============================================================================
--- head/sys/net/altq/altq_rmclass.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/net/altq/altq_rmclass.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -87,7 +87,7 @@ static mbuf_t	*_rmc_pollq(rm_class_t *);
 static int	rmc_under_limit(struct rm_class *, struct timeval *);
 static void	rmc_tl_satisfied(struct rm_ifdat *, struct timeval *);
 static void	rmc_drop_action(struct rm_class *);
-static void	rmc_restart(struct rm_class *);
+static void	rmc_restart(void *);
 static void	rmc_root_overlimit(struct rm_class *, struct rm_class *);
 
 #define	BORROW_OFFTIME
@@ -1530,8 +1530,7 @@ rmc_delay_action(struct rm_class *cl, struct rm_class 
 			t = hzto(&cl->undertime_);
 		} else
 			t = 2;
-		CALLOUT_RESET(&cl->callout_, t,
-			      (timeout_t *)rmc_restart, (caddr_t)cl);
+		CALLOUT_RESET(&cl->callout_, t, rmc_restart, cl);
 	}
 }
 
@@ -1553,8 +1552,9 @@ rmc_delay_action(struct rm_class *cl, struct rm_class 
  */
 
 static void
-rmc_restart(struct rm_class *cl)
+rmc_restart(void *arg)
 {
+	struct rm_class *cl = arg;
 	struct rm_ifdat	*ifd = cl->ifdat_;
 	int		 s;
 

Modified: head/sys/powerpc/mpc85xx/fsl_sata.c
==============================================================================
--- head/sys/powerpc/mpc85xx/fsl_sata.c	Thu Dec  5 16:50:54 2019	(r355425)
+++ head/sys/powerpc/mpc85xx/fsl_sata.c	Thu Dec  5 18:47:29 2019	(r355426)
@@ -70,7 +70,7 @@ static void fsl_sata_intr_main(struct fsl_sata_channel
 static void fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb);
 static void fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error);
 static void fsl_sata_execute_transaction(struct fsl_sata_slot *slot);
-static void fsl_sata_timeout(struct fsl_sata_slot *slot);
+static void fsl_sata_timeout(void *arg);
 static void fsl_sata_end_transaction(struct fsl_sata_slot *slot, enum fsl_sata_err_type et);
 static int fsl_sata_setup_fis(struct fsl_sata_channel *ch, struct fsl_sata_cmd_tab *ctp, union ccb *ccb, int tag);
 static void fsl_sata_dmainit(device_t dev);
@@ -1107,7 +1107,7 @@ fsl_sata_execute_transaction(struct fsl_sata_slot *slo
 	}
 	/* Start command execution timeout */
 	callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout / 2,
-	    0, (timeout_t*)fsl_sata_timeout, slot, 0);
+	    0, fsl_sata_timeout, slot, 0);
 	return;
 }
 
@@ -1144,14 +1144,15 @@ fsl_sata_rearm_timeout(struct fsl_sata_channel *ch)
 			continue;
 		callout_reset_sbt(&slot->timeout,
  	    	    SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
-		    (timeout_t*)fsl_sata_timeout, slot, 0);
+		    fsl_sata_timeout, slot, 0);
 	}
 }
 
 /* Locked by callout mechanism. */
 static void
-fsl_sata_timeout(struct fsl_sata_slot *slot)
+fsl_sata_timeout(void *arg)
 {
+	struct fsl_sata_slot *slot = arg;
 	struct fsl_sata_channel *ch = slot->ch;
 	device_t dev = ch->dev;
 	uint32_t sstatus;
@@ -1169,7 +1170,7 @@ fsl_sata_timeout(struct fsl_sata_slot *slot)
 
 		callout_reset_sbt(&slot->timeout,
 	    	    SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
-		    (timeout_t*)fsl_sata_timeout, slot, 0);
+		    fsl_sata_timeout, slot, 0);
 		return;
 	}
 


More information about the svn-src-all mailing list