summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjah <jah@FreeBSD.org>2015-08-14 18:01:40 +0000
committerjah <jah@FreeBSD.org>2015-08-14 18:01:40 +0000
commit07d2b0515540704d0227b67d81831be749992f53 (patch)
tree8431164c54d8c1dd9457ac238afb18e99260d22a /sys
parent66c058ca9c5acb2ea7dd0e8db746cce9b93999e5 (diff)
downloadFreeBSD-src-07d2b0515540704d0227b67d81831be749992f53.zip
FreeBSD-src-07d2b0515540704d0227b67d81831be749992f53.tar.gz
Reformat x86 bounce buffer synchronization code to reduce indentation. No functional change.
Approved by: kib (mentor)
Diffstat (limited to 'sys')
-rw-r--r--sys/x86/x86/busdma_bounce.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c
index dcdeafa..25cd002 100644
--- a/sys/x86/x86/busdma_bounce.c
+++ b/sys/x86/x86/busdma_bounce.c
@@ -758,47 +758,43 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map,
{
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++;
}
}
OpenPOWER on IntegriCloud