svn commit: r286785 - head/sys/x86/x86
Jason A. Harmening
jah at FreeBSD.org
Fri Aug 14 18:01:41 UTC 2015
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++;
}
}
More information about the svn-src-all
mailing list