Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga/dev PR/50928: David Binderman: Clarify preced...



details:   https://anonhg.NetBSD.org/src/rev/c06d20845950
branches:  trunk
changeset: 814158:c06d20845950
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 09 20:11:41 2016 +0000

description:
PR/50928: David Binderman: Clarify precedence with parentheses.

diffstat:

 sys/arch/amiga/dev/sbic.c |  192 +++++++++++++++++++++++-----------------------
 1 files changed, 96 insertions(+), 96 deletions(-)

diffs (truncated from 714 to 300 lines):

diff -r fc08c7ef4ca2 -r c06d20845950 sys/arch/amiga/dev/sbic.c
--- a/sys/arch/amiga/dev/sbic.c Wed Mar 09 20:07:04 2016 +0000
+++ b/sys/arch/amiga/dev/sbic.c Wed Mar 09 20:11:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbic.c,v 1.74 2015/01/19 20:10:27 phx Exp $ */
+/*     $NetBSD: sbic.c,v 1.75 2016/03/09 20:11:41 christos Exp $ */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -81,7 +81,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.74 2015/01/19 20:10:27 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.75 2016/03/09 20:11:41 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -259,8 +259,8 @@
        struct sbic_acb* acb;
 
        SBIC_TRACE(dev);
-       if( !dev->sc_cur ) return;
-       if( !(dev->sc_flags & SBICF_INDMA) ) return; /* DMA not active */
+       if (!dev->sc_cur) return;
+       if (!(dev->sc_flags & SBICF_INDMA)) return; /* DMA not active */
 
        s = splbio();
 
@@ -268,13 +268,13 @@
        count = -1;
        do {
                GET_SBIC_asr(regs, asr);
-               if( asr & SBIC_ASR_DBR ) {
+               if (asr & SBIC_ASR_DBR) {
                        printf("sbic_save_ptrs: asr %02x canceled!\n", asr);
                        splx(s);
                        SBIC_TRACE(dev);
                        return;
                }
-       } while( asr & (SBIC_ASR_BSY|SBIC_ASR_CIP) );
+       } while (asr & (SBIC_ASR_BSY|SBIC_ASR_CIP));
 
        /* Save important state */
        /* must be done before dmastop */
@@ -287,8 +287,8 @@
        SBIC_TC_PUT(regs, 0);
 
 #ifdef DEBUG
-       if(!count && sbic_debug) printf("%dcount0",target);
-       if(data_pointer_debug == -1)
+       if (!count && sbic_debug) printf("%dcount0",target);
+       if (data_pointer_debug == -1)
                printf("SBIC saving target %d data pointers from (%p,%x)%xASR:%02x",
                       target, dev->sc_cur->dc_addr, dev->sc_cur->dc_count,
                       acb->sc_dmacmd, asr);
@@ -302,7 +302,7 @@
 
        acb->sc_tcnt = dev->sc_tcnt = count;
 #ifdef DEBUG
-       if(data_pointer_debug)
+       if (data_pointer_debug)
                printf(" at (%p,%x):%x\n",
                       dev->sc_cur->dc_addr, dev->sc_cur->dc_count,count);
        sbicdma_saves++;
@@ -324,7 +324,7 @@
 
        SBIC_TRACE(dev);
        acb = dev->sc_nexus;
-       if( !acb->sc_kv.dc_count ) {
+       if (!acb->sc_kv.dc_count) {
                /* No data to xfer */
                SBIC_TRACE(dev);
                return;
@@ -339,7 +339,7 @@
 #ifdef DEBUG
        sbicdma_ops++;
 #endif
-       if( !dev->sc_tcnt ) {
+       if (!dev->sc_tcnt) {
                /* sc_tcnt == 0 implies end of segment */
 
                /* do kvm to pa mappings */
@@ -348,12 +348,12 @@
 
                vaddr = acb->sc_kv.dc_addr;
                count = acb->sc_kv.dc_count;
-               for(count = (PAGE_SIZE - ((int)vaddr & PGOFSET));
+               for (count = (PAGE_SIZE - ((int)vaddr & PGOFSET));
                    count < acb->sc_kv.dc_count
                    && (char*)kvtop(vaddr + count + 4) == paddr + count + 4;
                    count += PAGE_SIZE);
                /* If it's all contiguous... */
-               if(count > acb->sc_kv.dc_count ) {
+               if (count > acb->sc_kv.dc_count) {
                        count = acb->sc_kv.dc_count;
 #ifdef DEBUG
                        sbicdma_hits++;
@@ -367,7 +367,7 @@
                acb->sc_pa.dc_count = count >> 1;
 
 #ifdef DEBUG
-               if(data_pointer_debug)
+               if (data_pointer_debug)
                        printf("DMA recalc:kv(%p,%x)pa(%p,%lx)\n",
                               acb->sc_kv.dc_addr,
                               acb->sc_kv.dc_count,
@@ -377,7 +377,7 @@
        }
        splx(s);
 #ifdef DEBUG
-       if(data_pointer_debug)
+       if (data_pointer_debug)
                printf("SBIC restoring target %d data pointers at (%p,%x)%x\n",
                       target, dev->sc_cur->dc_addr, dev->sc_cur->dc_count,
                       dev->sc_dmacmd);
@@ -447,7 +447,7 @@
 
                        dev->sc_flags |= SBICF_ICMD;
                        do {
-                               while(dev->sc_nexus)
+                               while (dev->sc_nexus)
                                        sbicpoll(dev);
                                dev->sc_nexus = acb;
                                dev->sc_stat[0] = -1;
@@ -539,14 +539,14 @@
                sbicreset(dev);
 
 #ifdef DEBUG
-       if( data_pointer_debug > 1 )
+       if (data_pointer_debug > 1)
                printf("sbic_sched(%d,%d)\n", periph->periph_target,
                        periph->periph_lun);
 #endif
        dev->sc_stat[0] = -1;
        dev->target = periph->periph_target;
        dev->lun = periph->periph_lun;
-       if ( flags & XS_CTL_POLL || ( !sbic_parallel_operations
+       if (flags & XS_CTL_POLL || (!sbic_parallel_operations
                                   && (sbicdmaok(dev, xs) == 0)))
                stat = sbicicmd(dev, periph->periph_target,
                        periph->periph_lun, &acb->cmd,
@@ -587,11 +587,11 @@
        xs->status = stat;
        xs->resid = 0;          /* XXXX */
 #ifdef DEBUG
-       if( data_pointer_debug > 1 )
+       if (data_pointer_debug > 1)
                printf("scsidone: (%d,%d)->(%d,%d)%02x\n",
                       periph->periph_target, periph->periph_lun,
                       dev->target,  dev->lun,  stat);
-       if( periph->periph_target ==
+       if (periph->periph_target ==
                periph->periph_channel->chan_id)
                panic("target == hostid");
 #endif
@@ -749,14 +749,14 @@
 
        /* Clean up chip itself */
        if (dev->sc_flags & SBICF_SELECTED) {
-               while( asr & SBIC_ASR_DBR ) {
+               while (asr & SBIC_ASR_DBR) {
                        /* sbic is jammed w/data. need to clear it */
                        /* But we don't know what direction it needs to go */
                        GET_SBIC_data(regs, asr);
                        printf("%s: abort %s: clearing data buffer 0x%02x\n",
                               device_xname(dev->sc_dev), where, asr);
                        GET_SBIC_asr(regs, asr);
-                       if( asr & SBIC_ASR_DBR ) /* Not the read direction, then */
+                       if (asr & SBIC_ASR_DBR) /* Not the read direction, then */
                                SET_SBIC_data(regs, asr);
                        GET_SBIC_asr(regs, asr);
                }
@@ -995,7 +995,7 @@
                SET_SBIC_syn(regs, SBIC_SYN (0, sbic_min_period));
 
        GET_SBIC_asr(regs, asr);
-       if( asr & (SBIC_ASR_INT|SBIC_ASR_BSY) ) {
+       if (asr & (SBIC_ASR_INT|SBIC_ASR_BSY)) {
                /* This means we got ourselves reselected upon */
 /*             printf("sbicselectbus: INT/BSY asr %02x\n", asr);*/
 #ifdef DDB
@@ -1025,9 +1025,9 @@
                GET_SBIC_csr (regs, csr);
                CSR_TRACE('s',csr,asr,target);
                QPRINTF(("%02x ", csr));
-               if( csr == SBIC_CSR_RSLT_NI || csr == SBIC_CSR_RSLT_IFY) {
+               if (csr == SBIC_CSR_RSLT_NI || csr == SBIC_CSR_RSLT_IFY) {
 #ifdef DEBUG
-                       if(reselect_debug)
+                       if (reselect_debug)
                                printf("sbicselectbus: reselected asr %02x\n", asr);
 #endif
                        /* We need to handle this now so we don't lock up later */
@@ -1035,7 +1035,7 @@
                        SBIC_TRACE(dev);
                        return 1;
                }
-               if( csr == SBIC_CSR_SLT || csr == SBIC_CSR_SLT_ATN) {
+               if (csr == SBIC_CSR_SLT || csr == SBIC_CSR_SLT_ATN) {
                        panic("sbicselectbus: target issued select!");
                        return 1;
                }
@@ -1043,7 +1043,7 @@
            && csr != (SBIC_CSR_MIS_2|CMD_PHASE) && csr != SBIC_CSR_SEL_TIMEO);
 
        /* Enable (or not) reselection */
-       if(!sbic_enable_reselect && dev->nexus_list.tqh_first == NULL)
+       if (!sbic_enable_reselect && dev->nexus_list.tqh_first == NULL)
                SET_SBIC_rselid (regs, 0);
        else
                SET_SBIC_rselid (regs, SBIC_RID_ER);
@@ -1053,7 +1053,7 @@
                GET_SBIC_selid(regs, id);
                dev->target = id;
                GET_SBIC_tlun(regs,dev->lun);
-               if( dev->lun & SBIC_TLUN_VALID )
+               if (dev->lun & SBIC_TLUN_VALID)
                        dev->lun &= SBIC_TLUN_MASK;
                else
                        dev->lun = lun;
@@ -1065,7 +1065,7 @@
                GET_SBIC_selid(regs, id);
                dev->target = id;
                GET_SBIC_tlun(regs,dev->lun);
-               if( dev->lun & SBIC_TLUN_VALID )
+               if (dev->lun & SBIC_TLUN_VALID)
                        dev->lun &= SBIC_TLUN_MASK;
                else
                        dev->lun = lun;
@@ -1086,9 +1086,9 @@
 
 
                if (dev->sc_sync[id].state != SYNC_START){
-                       if( dev->sc_xs->xs_control & XS_CTL_POLL
+                       if (dev->sc_xs->xs_control & XS_CTL_POLL
                           || (dev->sc_flags & SBICF_ICMD)
-                          || !sbic_enable_reselect )
+                          || !sbic_enable_reselect)
                                SEND_BYTE (regs, MSG_IDENTIFY | lun);
                        else
                                SEND_BYTE (regs, MSG_IDENTIFY_DR | lun);
@@ -1253,7 +1253,7 @@
        SET_SBIC_cmd (regs, SBIC_CMD_XFER_INFO);
        for (;len > 0; len--) {
                GET_SBIC_asr (regs, asr);
-               if((asr & SBIC_ASR_PE)) {
+               if ((asr & SBIC_ASR_PE)) {
 #ifdef DEBUG
                        printf("sbicxfin parity error: l%d i%x w%d\n",
                               len, asr, wait);
@@ -1340,7 +1340,7 @@
 #ifdef DEBUG
        routine = 3;
        debug_sbic_regs = regs; /* store this to allow debug calls */
-       if( data_pointer_debug > 1 )
+       if (data_pointer_debug > 1)
                printf("sbicicmd(%d,%d):%d\n", target, lun,
                       acb->sc_kv.dc_count);
 #endif
@@ -1361,7 +1361,7 @@
                /*
                 * select the SCSI bus (it's an error if bus isn't free)
                 */
-               if (!( dev->sc_flags & SBICF_SELECTED )
+               if (!(dev->sc_flags & SBICF_SELECTED)
                    && sbicselectbus(dev, regs, target, lun, dev->sc_scsiaddr)) {
                        /* printf("sbicicmd: trying to select busy bus!\n"); */
                        dev->sc_flags &= ~SBICF_ICMD;
@@ -1397,7 +1397,7 @@
 /*                             break; */ /* Bypass all the state gobldygook */
                        } else {
 #ifdef DEBUG
-                               if(reselect_debug>1)
+                               if (reselect_debug>1)
                                        printf("sbicicmd: handling disconnect\n");
 #endif
                                i = SBIC_STATE_DISCONNECT;
@@ -1417,7 +1417,7 @@
                        WAIT_CIP(regs);
                        GET_SBIC_asr(regs, asr);
                        CSR_TRACE('I',csr,asr,target);
-                       if( asr & (SBIC_ASR_BSY|SBIC_ASR_LCI|SBIC_ASR_CIP) )
+                       if (asr & (SBIC_ASR_BSY|SBIC_ASR_LCI|SBIC_ASR_CIP))
                                printf("next: cmd sent asr %02x, csr %02x\n",
                                       asr, csr);
 #endif
@@ -1466,7 +1466,7 @@
                         * so do this with its hi-level commands.
                         */
 #ifdef DEBUG
-                       if(sbic_debug)
+                       if (sbic_debug)
                                printf("SBICICMD status phase\n");
 #endif
                        SBIC_TC_PUT(regs, 0);
@@ -1476,7 +1476,7 @@
 
 #if THIS_IS_A_RESERVED_STATE
                case BUS_FREE_PHASE:            /* This is not legal */



Home | Main Index | Thread Index | Old Index