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/dev | |
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/dev')
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 4 | ||||
-rw-r--r-- | sys/dev/mcd/mcd.c | 6 | ||||
-rw-r--r-- | sys/dev/mse/mse.c | 10 | ||||
-rw-r--r-- | sys/dev/rc/rc.c | 5 | ||||
-rw-r--r-- | sys/dev/rp/rp.c | 9 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 10 |
6 files changed, 23 insertions, 21 deletions
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index c102444..d5606eb 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/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/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 8297679..9d615ed 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/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/dev/mse/mse.c b/sys/dev/mse/mse.c index 001da0c..e952af0 100644 --- a/sys/dev/mse/mse.c +++ b/sys/dev/mse/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/dev/rc/rc.c b/sys/dev/rc/rc.c index 613f8cb..aeeb9c5 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/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/dev/rp/rp.c b/sys/dev/rp/rp.c index 39972dd..410a857 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/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/dev/sio/sio.c b/sys/dev/sio/sio.c index 4c62ca9..333235f 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.227 1999/04/24 10:41:21 dt Exp $ + * $Id: sio.c,v 1.228 1999/04/27 11:15:42 phk Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1395,9 +1395,9 @@ comhardclose(com) * the next open because it might go up and down while * we're not watching. */ - || !com->active_out - && !(com->prev_modem_status & MSR_DCD) - && !(com->it_in.c_cflag & CLOCAL) + || (!com->active_out + && !(com->prev_modem_status & MSR_DCD) + && !(com->it_in.c_cflag & CLOCAL)) || !(tp->t_state & TS_ISOPEN)) { (void)commctl(com, TIOCM_DTR, DMBIC); if (com->dtr_wait != 0 && !(com->state & CS_DTR_OFF)) { @@ -2074,7 +2074,7 @@ comparam(tp, t) /* check requested parameters */ divisor = ttspeedtab(t->c_ospeed, comspeedtab); - if (divisor < 0 || divisor > 0 && t->c_ispeed != t->c_ospeed) + if (divisor < 0 || (divisor > 0 && t->c_ispeed != t->c_ospeed)) return (EINVAL); /* parameters are OK, convert them to the com struct and the device */ |