diff options
author | peter <peter@FreeBSD.org> | 1999-05-06 18:44:42 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-05-06 18:44:42 +0000 |
commit | 459d4a2cc5e6111860f2c6a86117a230d98dd4e9 (patch) | |
tree | 3ebec15b9f996d9b97c11ef575d325c41cea11f1 /sys/i386/isa | |
parent | daa969b0667e983bbabc44c8ddcda321b70523c5 (diff) | |
download | FreeBSD-src-459d4a2cc5e6111860f2c6a86117a230d98dd4e9.zip FreeBSD-src-459d4a2cc5e6111860f2c6a86117a230d98dd4e9.tar.gz |
Fix up a few easy 'assignment used as truth value' and 'suggest parens
around && within ||' type warnings. I'm pretty sure I have not masked
any problems here, I've committed real problem fixes seperately.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/if_lnc.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/if_ze.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/mcd.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/mse.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/rc.c | 5 | ||||
-rw-r--r-- | sys/i386/isa/rp.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/stallion.c | 5 | ||||
-rw-r--r-- | sys/i386/isa/tw.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/wst.c | 5 | ||||
-rw-r--r-- | sys/i386/isa/wt.c | 32 |
10 files changed, 53 insertions, 36 deletions
diff --git a/sys/i386/isa/if_lnc.c b/sys/i386/isa/if_lnc.c index c102444..d5606eb 100644 --- a/sys/i386/isa/if_lnc.c +++ b/sys/i386/isa/if_lnc.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_lnc.c,v 1.57 1999/04/18 01:49:16 paul Exp $ + * $Id: if_lnc.c,v 1.58 1999/05/06 18:12:26 peter Exp $ */ /* @@ -2032,7 +2032,7 @@ mbuf_dump_chain(struct mbuf * m) m->M_dat.MH.MH_dat.MH_ext.ext_size); } } - } while (m = m->m_next); + } while ((m = m->m_next) != NULL); } #endif diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c index 3edcf4c..28fbaa9 100644 --- a/sys/i386/isa/if_ze.c +++ b/sys/i386/isa/if_ze.c @@ -47,7 +47,7 @@ */ /* - * $Id: if_ze.c,v 1.56 1998/12/07 21:58:21 archie Exp $ + * $Id: if_ze.c,v 1.57 1999/05/06 18:12:27 peter Exp $ */ /* XXX don't mix different PCCARD support code. */ @@ -1167,7 +1167,7 @@ zeintr(unit) /* * loop until there are no more new interrupts */ - while (isr = inb(sc->nic_addr + ED_P0_ISR)) { + while ((isr = inb(sc->nic_addr + ED_P0_ISR)) != 0) { /* * reset all the bits that we are 'acknowleging' diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index 8297679..9d615ed 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.101 1998/10/22 05:58:39 bde Exp $ + * $Id: mcd.c,v 1.102 1999/04/28 10:52:41 dt Exp $ */ static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -1502,8 +1502,8 @@ mcd_toc_entrys(int unit, struct ioc_read_toc_entry *te) if ( te->data_len < sizeof(entries[0]) || (te->data_len % sizeof(entries[0])) != 0 - || te->address_format != CD_MSF_FORMAT - && te->address_format != CD_LBA_FORMAT + || (te->address_format != CD_MSF_FORMAT + && te->address_format != CD_LBA_FORMAT) ) return EINVAL; diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index 001da0c..e952af0 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.40 1999/04/28 10:52:43 dt Exp $ + * $Id: mse.c,v 1.41 1999/05/06 18:12:28 peter Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -357,8 +357,9 @@ mseread(dev, uio, ioflag) return (0); } sc->sc_flags |= MSESC_WANT; - if (error = tsleep((caddr_t)sc, MSEPRI | PCATCH, - "mseread", 0)) { + error = tsleep((caddr_t)sc, MSEPRI | PCATCH, + "mseread", 0); + if (error) { splx(s); return (error); } @@ -391,7 +392,8 @@ mseread(dev, uio, ioflag) } splx(s); xfer = min(uio->uio_resid, sc->mode.packetsize - sc->sc_bytesread); - if (error = uiomove(&sc->sc_bytes[sc->sc_bytesread], xfer, uio)) + error = uiomove(&sc->sc_bytes[sc->sc_bytesread], xfer, uio); + if (error) return (error); sc->sc_bytesread += xfer; return(0); diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c index 613f8cb..aeeb9c5 100644 --- a/sys/i386/isa/rc.c +++ b/sys/i386/isa/rc.c @@ -760,8 +760,9 @@ again: error = EBUSY; goto out; } - if (error = tsleep(&rc->rc_rcb, - TTIPRI|PCATCH, "rcbi", 0)) + error = tsleep(&rc->rc_rcb, + TTIPRI|PCATCH, "rcbi", 0); + if (error) goto out; goto again; } diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c index 39972dd..410a857 100644 --- a/sys/i386/isa/rp.c +++ b/sys/i386/isa/rp.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: rp.c,v 1.23 1999/04/24 20:26:12 billf Exp $ + * $Id: rp.c,v 1.24 1999/04/27 11:15:12 phk Exp $ */ /* @@ -1555,10 +1555,9 @@ rpwrite(dev, uio, flag) tp = rp->rp_tty; while(rp->rp_disable_writes) { rp->rp_waiting = 1; - if(error = ttysleep(tp, (caddr_t)rp, TTOPRI|PCATCH, - "rp_write", 0)) { + error = ttysleep(tp, (caddr_t)rp, TTOPRI|PCATCH, "rp_write", 0); + if (error) return(error); - } } error = (*linesw[tp->t_line].l_write)(tp, uio, flag); @@ -1661,7 +1660,7 @@ rpioctl(dev, cmd, data, flag, p) dt->c_lflag = (tp->t_lflag & lt->c_lflag) | (dt->c_lflag & ~lt->c_lflag); for(cc = 0; cc < NCCS; ++cc) - if(lt->c_cc[cc] = tp->t_cc[cc]) + if((lt->c_cc[cc] = tp->t_cc[cc]) != 0) dt->c_cc[cc] = tp->t_cc[cc]; if(lt->c_ispeed != 0) dt->c_ispeed = tp->t_ispeed; diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c index 52dbaaf..97b564d 100644 --- a/sys/i386/isa/stallion.c +++ b/sys/i386/isa/stallion.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: stallion.c,v 1.27 1999/04/27 11:15:19 phk Exp $ + * $Id: stallion.c,v 1.28 1999/04/28 10:52:57 dt Exp $ */ /*****************************************************************************/ @@ -2053,7 +2053,8 @@ static void stl_rxprocess(stlport_t *portp) } else { while (portp->rx.tail != head) { ch = (unsigned char) *(portp->rx.tail); - if (status = *(portp->rx.tail + STL_RXBUFSIZE)) { + status = *(portp->rx.tail + STL_RXBUFSIZE); + if (status) { *(portp->rx.tail + STL_RXBUFSIZE) = 0; if (status & ST_BREAK) ch |= TTY_BI; diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c index 0fb02ed..3b7b176 100644 --- a/sys/i386/isa/tw.c +++ b/sys/i386/isa/tw.c @@ -481,7 +481,8 @@ int twwrite(dev, uio, ioflag) */ s = spltty(); cnt = MIN(3 - sc->sc_pktsize, uio->uio_resid); - if(error = uiomove(&(sc->sc_pkt[sc->sc_pktsize]), cnt, uio)) { + error = uiomove(&(sc->sc_pkt[sc->sc_pktsize]), cnt, uio); + if(error) { splx(s); return(error); } @@ -509,7 +510,8 @@ int twwrite(dev, uio, ioflag) * originated locally. */ while(sc->sc_state & (TWS_RCVING | TWS_XMITTING)) { - if(error = tsleep((caddr_t)sc, TWPRI|PCATCH, "twwrite", 0)) { + error = tsleep((caddr_t)sc, TWPRI|PCATCH, "twwrite", 0); + if(error) { splx(s); return(error); } @@ -860,7 +862,8 @@ int cnt; while(cnt--) { while(sc->sc_nextin == sc->sc_nextout) { /* Buffer empty */ sc->sc_state |= TWS_WANT; - if(error = tsleep((caddr_t)(&sc->sc_buf), TWPRI|PCATCH, "twread", 0)) { + error = tsleep((caddr_t)(&sc->sc_buf), TWPRI|PCATCH, "twread", 0); + if(error) { return(error); } } diff --git a/sys/i386/isa/wst.c b/sys/i386/isa/wst.c index c9d6d3f..5d0827e 100644 --- a/sys/i386/isa/wst.c +++ b/sys/i386/isa/wst.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: wst.c,v 1.17 1999/04/28 10:53:06 dt Exp $ + * $Id: wst.c,v 1.18 1999/05/02 21:46:31 peter Exp $ */ #include "wdc.h" @@ -744,7 +744,8 @@ wst_erase(struct wst *t) int error; struct atapires result; - if (error = wst_rewind(t)) + error = wst_rewind(t); + if (error) return error; result = atapi_request_wait(t->ata, t->unit, ATAPI_TAPE_ERASE, 3, 0, 0, 0, diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index b6dd3b6..8efa720 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -20,7 +20,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id: wt.c,v 1.47 1998/12/18 18:07:10 bde Exp $ + * $Id: wt.c,v 1.48 1999/04/28 10:53:07 dt Exp $ * */ @@ -295,7 +295,8 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p) /* If the tape is in rewound state, check the status and set density. */ if (t->flags & TPSTART) { /* If rewind is going on, wait */ - if (error = wtwait (t, PCATCH, "wtrew")) + error = wtwait (t, PCATCH, "wtrew"); + if (error) return (error); /* Check the controller status */ @@ -450,28 +451,34 @@ wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p) case MTOFFL: /* rewind and put the drive offline */ if (t->flags & TPREW) /* rewind is running */ return (0); - if (error = wtwait (t, PCATCH, "wtorew")) + error = wtwait (t, PCATCH, "wtorew"); + if (error) return (error); wtrewind (t); return (0); case MTFSF: /* forward space file */ for (count=((struct mtop*)arg)->mt_count; count>0; --count) { - if (error = wtwait (t, PCATCH, "wtorfm")) + error = wtwait (t, PCATCH, "wtorfm"); + if (error) return (error); - if (error = wtreadfm (t)) + error = wtreadfm (t); + if (error) return (error); } return (0); case MTWEOF: /* write an end-of-file record */ if (! (t->flags & TPWRITE) || (t->flags & TPWP)) return (EACCES); - if (error = wtwait (t, PCATCH, "wtowfm")) + error = wtwait (t, PCATCH, "wtowfm"); + if (error) return (error); - if (error = wtwritefm (t)) + error = wtwritefm (t); + if (error) return (error); return (0); case MTRETENS: /* re-tension tape */ - if (error = wtwait (t, PCATCH, "wtretens")) + error = wtwait (t, PCATCH, "wtretens"); + if (error) return (error); op = QIC_RETENS; goto erase_retens; @@ -479,7 +486,8 @@ wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p) case MTERASE: /* erase to EOM */ if (! (t->flags & TPWRITE) || (t->flags & TPWP)) return (EACCES); - if (error = wtwait (t, PCATCH, "wterase")) + error = wtwait (t, PCATCH, "wterase"); + if (error) return (error); op = QIC_ERASE; erase_retens: @@ -789,9 +797,11 @@ wtwait (wtinfo_t *t, int catch, char *msg) int error; TRACE (("wtwait() `%s'\n", msg)); - while (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK)) - if (error = tsleep ((caddr_t)t, WTPRI | catch, msg, 0)) + while (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK)) { + error = tsleep ((caddr_t)t, WTPRI | catch, msg, 0); + if (error) return (error); + } return (0); } |