Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2014 16:07:56 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270225 - head/sys/cam/scsi
Message-ID:  <201408201607.s7KG7u3i080394@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Aug 20 16:07:56 2014
New Revision: 270225
URL: http://svnweb.freebsd.org/changeset/base/270225

Log:
  Unexpand TAILQ_FOREACH().

Modified:
  head/sys/cam/scsi/scsi_low.c

Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c	Wed Aug 20 16:07:17 2014	(r270224)
+++ head/sys/cam/scsi/scsi_low.c	Wed Aug 20 16:07:56 2014	(r270225)
@@ -326,15 +326,13 @@ scsi_low_find_ccb(slp, target, lun, osde
 	if ((cb = slp->sl_Qnexus) != NULL && cb->osdep == osdep)
 		return cb;
 
-	for (cb = TAILQ_FIRST(&slp->sl_start); cb != NULL;
-	     cb = TAILQ_NEXT(cb, ccb_chain))
+	TAILQ_FOREACH(cb, &slp->sl_start, ccb_chain)
 	{
 		if (cb->osdep == osdep)
 			return cb;
 	}
 
-	for (cb = TAILQ_FIRST(&li->li_discq); cb != NULL;
-	     cb = TAILQ_NEXT(cb, ccb_chain))
+	TAILQ_FOREACH(cb, &li->li_discq, ccb_chain)
 	{
 		if (cb->osdep == osdep)
 			return cb;
@@ -4184,8 +4182,7 @@ scsi_low_info(slp, ti, s)
 	printf(">>>>> SCSI_LOW_INFO(0x%lx): %s\n", (u_long) slp->sl_Tnexus, s);
 	if (ti == NULL)
 	{
-		for (ti = TAILQ_FIRST(&slp->sl_titab); ti != NULL;
-		     ti = TAILQ_NEXT(ti, ti_chain))
+		TAILQ_FOREACH(ti, &slp->sl_titab, ti_chain)
 		{
 			scsi_low_print(slp, ti);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408201607.s7KG7u3i080394>