[Midnightbsd-cvs] src [9783] trunk/sys/dev/sym/sym_hipd.c: unused args

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Feb 22 08:33:32 EST 2018


Revision: 9783
          http://svnweb.midnightbsd.org/src/?rev=9783
Author:   laffer1
Date:     2018-02-22 08:33:32 -0500 (Thu, 22 Feb 2018)
Log Message:
-----------
unused args

Modified Paths:
--------------
    trunk/sys/dev/sym/sym_hipd.c

Modified: trunk/sys/dev/sym/sym_hipd.c
===================================================================
--- trunk/sys/dev/sym/sym_hipd.c	2018-02-22 13:32:49 UTC (rev 9782)
+++ trunk/sys/dev/sym/sym_hipd.c	2018-02-22 13:33:32 UTC (rev 9783)
@@ -589,11 +589,18 @@
  * BUS handle. A reverse table (hashed) is maintained for virtual
  * to BUS address translation.
  */
-static void getbaddrcb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+static void getbaddrcb(void *arg, bus_dma_segment_t *segs, int nseg __unused,
+    int error)
 {
 	bus_addr_t *baddr;
+
+	KASSERT(nseg == 1, ("%s: too many DMA segments (%d)", __func__, nseg));
+
 	baddr = (bus_addr_t *)arg;
-	*baddr = segs->ds_addr;
+	if (error)
+		*baddr = 0;
+	else
+		*baddr = segs->ds_addr;
 }
 
 static m_addr_t ___dma_getp(m_pool_s *mp)
@@ -1159,6 +1166,14 @@
 };
 
 /*
+ *  Assert some alignments required by the chip.
+ */
+CTASSERT(((offsetof(struct sym_reg, nc_sxfer) ^
+    offsetof(struct sym_tcb, head.sval)) &3) == 0);
+CTASSERT(((offsetof(struct sym_reg, nc_scntl3) ^
+    offsetof(struct sym_tcb, head.wval)) &3) == 0);
+
+/*
  *  Global LCB HEADER.
  *
  *  Due to lack of indirect addressing on earlier NCR chips,
@@ -1259,9 +1274,9 @@
  *  LUN(s) > 0.
  */
 #if SYM_CONF_MAX_LUN <= 1
-#define sym_lp(np, tp, lun) (!lun) ? (tp)->lun0p : 0
+#define sym_lp(tp, lun) (!lun) ? (tp)->lun0p : 0
 #else
-#define sym_lp(np, tp, lun) \
+#define sym_lp(tp, lun) \
 	(!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : 0
 #endif
 
@@ -2216,11 +2231,11 @@
 static void sym_int_ma (hcb_p np);
 static int  sym_dequeue_from_squeue(hcb_p np, int i, int target, int lun,
 				    int task);
-static void sym_sir_bad_scsi_status (hcb_p np, int num, ccb_p cp);
+static void sym_sir_bad_scsi_status (hcb_p np, ccb_p cp);
 static int  sym_clear_tasks (hcb_p np, int status, int targ, int lun, int task);
 static void sym_sir_task_recovery (hcb_p np, int num);
 static int  sym_evaluate_dp (hcb_p np, ccb_p cp, u32 scr, int *ofs);
-static void sym_modify_dp (hcb_p np, tcb_p tp, ccb_p cp, int ofs);
+static void sym_modify_dp(hcb_p np, ccb_p cp, int ofs);
 static int  sym_compute_residual (hcb_p np, ccb_p cp);
 static int  sym_show_msg (u_char * msg);
 static void sym_print_msg (ccb_p cp, char *label, u_char *msg);
@@ -2254,7 +2269,7 @@
 static int sym_scatter_sg_physical (hcb_p np, ccb_p cp,
 				    bus_dma_segment_t *psegs, int nsegs);
 static void sym_action2 (struct cam_sim *sim, union ccb *ccb);
-static void sym_update_trans (hcb_p np, tcb_p tp, struct sym_trans *tip,
+static void sym_update_trans(hcb_p np, struct sym_trans *tip,
 			      struct ccb_trans_settings *cts);
 static void sym_update_dflags(hcb_p np, u_char *flags,
 			      struct ccb_trans_settings *cts);
@@ -2349,6 +2364,7 @@
 
 static void sym_xpt_done(hcb_p np, union ccb *ccb, ccb_p cp)
 {
+
 	SYM_LOCK_ASSERT(MA_OWNED);
 
 	if (ccb->ccb_h.status & CAM_SIM_QUEUED) {
@@ -2362,6 +2378,7 @@
 
 static void sym_xpt_done2(hcb_p np, union ccb *ccb, int cam_status)
 {
+
 	SYM_LOCK_ASSERT(MA_OWNED);
 
 	sym_set_cam_status(ccb, cam_status);
@@ -4654,7 +4671,7 @@
  *  SCRATCHA is assumed to have been loaded with STARTPOS
  *  before the SCRIPTS called the C code.
  */
-static void sym_sir_bad_scsi_status(hcb_p np, int num, ccb_p cp)
+static void sym_sir_bad_scsi_status(hcb_p np, ccb_p cp)
 {
 	tcb_p tp	= &np->target[cp->target];
 	u32		startp;
@@ -5081,7 +5098,7 @@
 		 *  an IDENTIFY(lun) + ABORT MESSAGE.
 		 */
 		if (lun != -1) {
-			lcb_p lp = sym_lp(np, tp, lun);
+			lcb_p lp = sym_lp(tp, lun);
 			lp->to_clear = 0; /* We donnot expect to fail here */
 			np->abrt_msg[0] = M_IDENTIFY | lun;
 			np->abrt_msg[1] = M_ABORT;
@@ -5374,7 +5391,7 @@
  *  Btw, we assume in that situation that such a message
  *  is equivalent to a MODIFY DATA POINTER (offset=-1).
  */
-static void sym_modify_dp(hcb_p np, tcb_p tp, ccb_p cp, int ofs)
+static void sym_modify_dp(hcb_p np, ccb_p cp, int ofs)
 {
 	int dp_ofs	= ofs;
 	u32	dp_scr	= INL (nc_temp);
@@ -6103,7 +6120,7 @@
 	case SIR_BAD_SCSI_STATUS:
 		if (!cp)
 			goto out;
-		sym_sir_bad_scsi_status(np, num, cp);
+		sym_sir_bad_scsi_status(np, cp);
 		return;
 	/*
 	 *  We are asked by the SCRIPTS to prepare a
@@ -6177,7 +6194,7 @@
 					sym_print_msg(cp,"modify DP",np->msgin);
 				tmp = (np->msgin[3]<<24) + (np->msgin[4]<<16) +
 				      (np->msgin[5]<<8)  + (np->msgin[6]);
-				sym_modify_dp(np, tp, cp, tmp);
+				sym_modify_dp(np, cp, tmp);
 				return;
 			case M_X_SYNC_REQ:
 				sym_sync_nego(np, tp, cp);
@@ -6202,7 +6219,7 @@
 		case M_IGN_RESIDUE:
 			if (DEBUG_FLAGS & DEBUG_POINTER)
 				sym_print_msg(cp,"ign wide residue", np->msgin);
-			sym_modify_dp(np, tp, cp, -1);
+			sym_modify_dp(np, cp, -1);
 			return;
 		case M_REJECT:
 			if (INB (HS_PRT) == HS_NEGOTIATE)
@@ -6261,7 +6278,7 @@
 static	ccb_p sym_get_ccb (hcb_p np, u_char tn, u_char ln, u_char tag_order)
 {
 	tcb_p tp = &np->target[tn];
-	lcb_p lp = sym_lp(np, tp, ln);
+	lcb_p lp = sym_lp(tp, ln);
 	u_short tag = NO_TAG;
 	SYM_QUEHEAD *qp;
 	ccb_p cp = (ccb_p) NULL;
@@ -6384,10 +6401,10 @@
 /*
  *  Release one control block
  */
-static void sym_free_ccb (hcb_p np, ccb_p cp)
+static void sym_free_ccb(hcb_p np, ccb_p cp)
 {
 	tcb_p tp = &np->target[cp->target];
-	lcb_p lp = sym_lp(np, tp, cp->lun);
+	lcb_p lp = sym_lp(tp, cp->lun);
 
 	if (DEBUG_FLAGS & DEBUG_TAGS) {
 		PRINT_LUN(np, cp->target, cp->lun);
@@ -6572,27 +6589,12 @@
 }
 
 /*
- *  Target control block initialisation.
- *  Nothing important to do at the moment.
- */
-static void sym_init_tcb (hcb_p np, u_char tn)
-{
-	/*
-	 *  Check some alignments required by the chip.
-	 */
-	assert (((offsetof(struct sym_reg, nc_sxfer) ^
-		offsetof(struct sym_tcb, head.sval)) &3) == 0);
-	assert (((offsetof(struct sym_reg, nc_scntl3) ^
-		offsetof(struct sym_tcb, head.wval)) &3) == 0);
-}
-
-/*
  *  Lun control block allocation and initialization.
  */
 static lcb_p sym_alloc_lcb (hcb_p np, u_char tn, u_char ln)
 {
 	tcb_p tp = &np->target[tn];
-	lcb_p lp = sym_lp(np, tp, ln);
+	lcb_p lp = sym_lp(tp, ln);
 
 	/*
 	 *  Already done, just return.
@@ -6605,11 +6607,6 @@
 	assert(!sym_is_bit(tp->busy0_map, ln));
 
 	/*
-	 *  Initialize the target control block if not yet.
-	 */
-	sym_init_tcb (np, tn);
-
-	/*
 	 *  Allocate the LCB bus address array.
 	 *  Compute the bus address of this table.
 	 */
@@ -6675,7 +6672,7 @@
 static void sym_alloc_lcb_tags (hcb_p np, u_char tn, u_char ln)
 {
 	tcb_p tp = &np->target[tn];
-	lcb_p lp = sym_lp(np, tp, ln);
+	lcb_p lp = sym_lp(tp, ln);
 	int i;
 
 	/*
@@ -7285,7 +7282,7 @@
 	 */
 	csio = &cp->cam_ccb->csio;
 	tp = &np->target[cp->target];
-	lp = sym_lp(np, tp, cp->lun);
+	lp = sym_lp(tp, cp->lun);
 
 	/*
 	 *  Assume device discovered on first success.
@@ -7484,7 +7481,7 @@
 	 *  Retrieve the target and lun descriptors.
 	 */
 	tp = &np->target[ccb_h->target_id];
-	lp = sym_lp(np, tp, ccb_h->target_lun);
+	lp = sym_lp(tp, ccb_h->target_lun);
 
 	/*
 	 *  Complete the 1st INQUIRY command with error
@@ -8022,14 +8019,14 @@
 		 *  Update SPI transport settings in TARGET control block.
 		 *  Update SCSI device settings in LUN control block.
 		 */
-		lp = sym_lp(np, tp, ccb_h->target_lun);
+		lp = sym_lp(tp, ccb_h->target_lun);
 		if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
-			sym_update_trans(np, tp, &tp->tinfo.goal, cts);
+			sym_update_trans(np, &tp->tinfo.goal, cts);
 			if (lp)
 				sym_update_dflags(np, &lp->current_flags, cts);
 		}
 		if (cts->type == CTS_TYPE_USER_SETTINGS) {
-			sym_update_trans(np, tp, &tp->tinfo.user, cts);
+			sym_update_trans(np, &tp->tinfo.user, cts);
 			if (lp)
 				sym_update_dflags(np, &lp->user_flags, cts);
 		}
@@ -8039,7 +8036,7 @@
 	case XPT_GET_TRAN_SETTINGS:
 		cts = &ccb->cts;
 		tp = &np->target[ccb_h->target_id];
-		lp = sym_lp(np, tp, ccb_h->target_lun);
+		lp = sym_lp(tp, ccb_h->target_lun);
 
 #define	cts__scsi (&cts->proto_specific.scsi)
 #define	cts__spi  (&cts->xport_specific.spi)
@@ -8164,7 +8161,7 @@
  *  Asynchronous notification handler.
  */
 static void
-sym_async(void *cb_arg, u32 code, struct cam_path *path, void *arg)
+sym_async(void *cb_arg, u32 code, struct cam_path *path, void *args __unused)
 {
 	hcb_p np;
 	struct cam_sim *sim;
@@ -8203,9 +8200,10 @@
 /*
  *  Update transfer settings of a target.
  */
-static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
-			    struct ccb_trans_settings *cts)
+static void sym_update_trans(hcb_p np, struct sym_trans *tip,
+    struct ccb_trans_settings *cts)
 {
+
 	SYM_LOCK_ASSERT(MA_OWNED);
 
 	/*
@@ -8282,6 +8280,7 @@
 static void
 sym_update_dflags(hcb_p np, u_char *flags, struct ccb_trans_settings *cts)
 {
+
 	SYM_LOCK_ASSERT(MA_OWNED);
 
 #define	cts__scsi (&cts->proto_specific.scsi)
@@ -8879,7 +8878,7 @@
 	for (target = 0; target < SYM_CONF_MAX_TARGET ; target++) {
 		tp = &np->target[target];
 		for (lun = 0 ; lun < SYM_CONF_MAX_LUN ; lun++) {
-			lp = sym_lp(np, tp, lun);
+			lp = sym_lp(tp, lun);
 			if (!lp)
 				continue;
 			if (lp->itlq_tbl)
@@ -8998,6 +8997,7 @@
  */
 static void sym_cam_free(hcb_p np)
 {
+
 	SYM_LOCK_ASSERT(MA_NOTOWNED);
 
 	if (np->intr) {



More information about the Midnightbsd-cvs mailing list