Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Aug 2015 18:01:40 +0000 (UTC)
From:      "Jason A. Harmening" <jah@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286785 - head/sys/x86/x86
Message-ID:  <201508141801.t7EI1evv078840@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jah
Date: Fri Aug 14 18:01:40 2015
New Revision: 286785
URL: https://svnweb.freebsd.org/changeset/base/286785

Log:
  Reformat x86 bounce buffer synchronization code to reduce indentation.  No functional change.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/x86/x86/busdma_bounce.c

Modified: head/sys/x86/x86/busdma_bounce.c
==============================================================================
--- head/sys/x86/x86/busdma_bounce.c	Fri Aug 14 17:49:03 2015	(r286784)
+++ head/sys/x86/x86/busdma_bounce.c	Fri Aug 14 18:01:40 2015	(r286785)
@@ -758,47 +758,43 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma
 {
 	struct bounce_page *bpage;
 
-	if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) {
-		/*
-		 * Handle data bouncing.  We might also
-		 * want to add support for invalidating
-		 * the caches on broken hardware
-		 */
-		CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x "
-		    "performing bounce", __func__, dmat,
-		    dmat->common.flags, op);
-
-		if ((op & BUS_DMASYNC_PREWRITE) != 0) {
-			while (bpage != NULL) {
-				if (bpage->datavaddr != 0) {
-					bcopy((void *)bpage->datavaddr,
-					    (void *)bpage->vaddr,
-					    bpage->datacount);
-				} else {
-					physcopyout(bpage->dataaddr,
-					    (void *)bpage->vaddr,
-					    bpage->datacount);
-				}
-				bpage = STAILQ_NEXT(bpage, links);
+	if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL)
+		return;
+
+	/*
+	 * Handle data bouncing.  We might also want to add support for
+	 * invalidating the caches on broken hardware.
+	 */
+	CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x "
+	    "performing bounce", __func__, dmat, dmat->common.flags, op);
+
+	if ((op & BUS_DMASYNC_PREWRITE) != 0) {
+		while (bpage != NULL) {
+			if (bpage->datavaddr != 0) {
+				bcopy((void *)bpage->datavaddr,
+				    (void *)bpage->vaddr, bpage->datacount);
+			} else {
+				physcopyout(bpage->dataaddr,
+				    (void *)bpage->vaddr, bpage->datacount);
 			}
-			dmat->bounce_zone->total_bounced++;
+			bpage = STAILQ_NEXT(bpage, links);
 		}
+		dmat->bounce_zone->total_bounced++;
+	}
 
-		if ((op & BUS_DMASYNC_POSTREAD) != 0) {
-			while (bpage != NULL) {
-				if (bpage->datavaddr != 0) {
-					bcopy((void *)bpage->vaddr,
-					    (void *)bpage->datavaddr,
-					    bpage->datacount);
-				} else {
-					physcopyin((void *)bpage->vaddr,
-					    bpage->dataaddr,
-					    bpage->datacount);
-				}
-				bpage = STAILQ_NEXT(bpage, links);
+	if ((op & BUS_DMASYNC_POSTREAD) != 0) {
+		while (bpage != NULL) {
+			if (bpage->datavaddr != 0) {
+				bcopy((void *)bpage->vaddr,
+				    (void *)bpage->datavaddr,
+				    bpage->datacount);
+			} else {
+				physcopyin((void *)bpage->vaddr,
+				    bpage->dataaddr, bpage->datacount);
 			}
-			dmat->bounce_zone->total_bounced++;
+			bpage = STAILQ_NEXT(bpage, links);
 		}
+		dmat->bounce_zone->total_bounced++;
 	}
 }
 



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