cleanup more SET/CLR/ISSET lossage

This commit is contained in:
christos 2006-03-05 17:33:33 +00:00
parent ef5477c67d
commit 1b2709754a
11 changed files with 38 additions and 88 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_43.c,v 1.20 2005/12/11 12:19:56 christos Exp $ */
/* $NetBSD: tty_43.c,v 1.21 2006/03/05 17:33:33 christos Exp $ */
/*-
* Copyright (c) 1982, 1986, 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.20 2005/12/11 12:19:56 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.21 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -84,11 +84,6 @@ static const int compatspcodes[] = {
1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200
};
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
int ttcompatgetflags __P((struct tty *));
void ttcompatsetflags __P((struct tty *, struct termios *));
void ttcompatsetlflags __P((struct tty *, struct termios *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: i2c_bitbang.c,v 1.2 2005/12/11 12:21:22 christos Exp $ */
/* $NetBSD: i2c_bitbang.c,v 1.3 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -44,7 +44,7 @@
#include <dev/i2c/i2cvar.h>
#include <dev/i2c/i2c_bitbang.h>
#define SET(x) ops->ibo_set_bits(v, (x))
#define SETBITS(x) ops->ibo_set_bits(v, (x))
#define DIR(x) ops->ibo_set_dir(v, (x))
#define READ ops->ibo_read_bits(v)
@ -60,11 +60,11 @@ i2c_bitbang_send_start(void *v, int flags, i2c_bitbang_ops_t ops)
DIR(OUTPUT);
SET(SDA | SCL);
SETBITS(SDA | SCL);
delay(5); /* bus free time (4.7 uS) */
SET( SCL);
SETBITS( SCL);
delay(4); /* start hold time (4.0 uS) */
SET( 0);
SETBITS( 0);
delay(5); /* clock low time (4.7 uS) */
return (0);
@ -77,9 +77,9 @@ i2c_bitbang_send_stop(void *v, int flags, i2c_bitbang_ops_t ops)
DIR(OUTPUT);
SET( SCL);
SETBITS( SCL);
delay(4); /* stop setup time (4.0 uS) */
SET(SDA | SCL);
SETBITS(SDA | SCL);
return (0);
}
@ -109,29 +109,29 @@ i2c_bitbang_read_byte(void *v, uint8_t *valp, int flags,
uint32_t bit;
DIR(INPUT);
SET(SDA );
SETBITS(SDA );
for (i = 0; i < 8; i++) {
val <<= 1;
SET(SDA | SCL);
SETBITS(SDA | SCL);
delay(4); /* clock high time (4.0 uS) */
if (READ & SDA)
val |= 1;
SET(SDA );
SETBITS(SDA );
delay(5); /* clock low time (4.7 uS) */
}
bit = (flags & I2C_F_LAST) ? SDA : 0;
DIR(OUTPUT);
SET(bit );
SETBITS(bit );
delay(1); /* data setup time (250 nS) */
SET(bit | SCL);
SETBITS(bit | SCL);
delay(4); /* clock high time (4.0 uS) */
SET(bit );
SETBITS(bit );
delay(5); /* clock low time (4.7 uS) */
DIR(INPUT);
SET(SDA );
SETBITS(SDA );
delay(5);
if ((flags & (I2C_F_STOP | I2C_F_LAST)) == (I2C_F_STOP | I2C_F_LAST))
@ -153,22 +153,22 @@ i2c_bitbang_write_byte(void *v, uint8_t val, int flags,
for (mask = 0x80; mask != 0; mask >>= 1) {
bit = (val & mask) ? SDA : 0;
SET(bit );
SETBITS(bit );
delay(1); /* data setup time (250 nS) */
SET(bit | SCL);
SETBITS(bit | SCL);
delay(4); /* clock high time (4.0 uS) */
SET(bit );
SETBITS(bit );
delay(5); /* clock low time (4.7 uS) */
}
DIR(INPUT);
SET(SDA );
SETBITS(SDA );
delay(5);
SET(SDA | SCL);
SETBITS(SDA | SCL);
delay(4);
error = (READ & SDA) ? EIO : 0;
SET(SDA );
SETBITS(SDA );
delay(5);
if (flags & I2C_F_STOP)

View File

@ -1,4 +1,4 @@
/* $NetBSD: comvar.h,v 1.50 2005/12/27 00:46:38 chs Exp $ */
/* $NetBSD: comvar.h,v 1.51 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -150,11 +150,6 @@ struct com_softc {
struct simplelock sc_lock;
};
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
int comprobe1(bus_space_tag_t, bus_space_handle_t);
int comintr(void *);
void com_attach_subr(struct com_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cy.c,v 1.39 2005/12/11 12:21:26 christos Exp $ */
/* $NetBSD: cy.c,v 1.40 2006/03/05 17:33:33 christos Exp $ */
/*
* cy.c
@ -16,7 +16,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.39 2005/12/11 12:21:26 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.40 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@ -39,11 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.39 2005/12/11 12:21:26 christos Exp $");
#include <dev/ic/cyreg.h>
#include <dev/ic/cyvar.h>
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
int cyparam(struct tty *, struct termios *);
void cystart(struct tty *);
void cy_poll(void *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: irframe_tty.c,v 1.31 2005/12/11 12:22:02 christos Exp $ */
/* $NetBSD: irframe_tty.c,v 1.32 2006/03/05 17:33:33 christos Exp $ */
/*
* TODO
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.31 2005/12/11 12:22:02 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.32 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -69,11 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.31 2005/12/11 12:22:02 christos Ex
#include <dev/ir/irdaio.h>
#include <dev/ir/irframevar.h>
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
#ifdef IRFRAMET_DEBUG
#define DPRINTF(x) if (irframetdebug) printf x
int irframetdebug = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cz.c,v 1.34 2005/12/11 12:22:49 christos Exp $ */
/* $NetBSD: cz.c,v 1.35 2006/03/05 17:33:33 christos Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.34 2005/12/11 12:22:49 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.35 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -189,11 +189,6 @@ static void cztty_diag(void *arg);
extern struct cfdriver cz_cd;
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
/*
* Macros to read and write the PLX.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucomvar.h,v 1.13 2005/12/11 12:24:01 christos Exp $ */
/* $NetBSD: ucomvar.h,v 1.14 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -38,11 +38,6 @@
*/
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
/* just for ucom_attach_args, not in the config namespace */
#define UCOM_UNK_PORTNO (-1)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucycom.c,v 1.7 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: ucycom.c,v 1.8 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: ucycom.c,v 1.7 2006/02/20 16:50:37 thorpej Exp $");
__RCSID("$NetBSD: ucycom.c,v 1.8 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,11 +87,6 @@ int ucycomdebug = 0;
#define UCYCOMDIALOUT(x) (minor(x) & UCYCOMDIALOUT_MASK)
#define UCYCOMCALLUNIT(x) (minor(x) & UCYCOMCALLUNIT_MASK)
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
/* Configuration Byte */
#define UCYCOM_RESET 0x80
#define UCYCOM_PARITY_TYPE_MASK 0x20

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay.c,v 1.89 2006/02/18 18:56:05 jmcneill Exp $ */
/* $NetBSD: wsdisplay.c,v 1.90 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.89 2006/02/18 18:56:05 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.90 2006/03/05 17:33:33 christos Exp $");
#include "opt_wsdisplay_border.h"
#include "opt_wsdisplay_compat.h"
@ -186,11 +186,6 @@ static void wsdisplaystart(struct tty *);
static int wsdisplayparam(struct tty *, struct termios *);
/* Internal macros, functions, and variables. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
#define WSDISPLAYUNIT(dev) (minor(dev) >> 8)
#define WSDISPLAYSCREEN(dev) (minor(dev) & 0xff)
#define ISWSDISPLAYSTAT(dev) (WSDISPLAYSCREEN(dev) == 254)

View File

@ -1,4 +1,4 @@
/* $NetBSD: procfs_ctl.c,v 1.30 2005/12/11 12:24:51 christos Exp $ */
/* $NetBSD: procfs_ctl.c,v 1.31 2006/03/05 17:33:33 christos Exp $ */
/*
* Copyright (c) 1993
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: procfs_ctl.c,v 1.30 2005/12/11 12:24:51 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: procfs_ctl.c,v 1.31 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -126,11 +126,6 @@ static const vfs_namemap_t signames[] = {
int procfs_control(struct lwp *, struct lwp *, int, int);
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
#define ISSET(t, f) ((t) & (f))
int
procfs_control(curl, l, op, sig)
struct lwp *curl;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_bio.c,v 1.89 2006/01/06 09:21:44 yamt Exp $ */
/* $NetBSD: lfs_bio.c,v 1.90 2006/03/05 17:33:33 christos Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.89 2006/01/06 09:21:44 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.90 2006/03/05 17:33:33 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,11 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.89 2006/01/06 09:21:44 yamt Exp $");
#include <uvm/uvm.h>
/* Macros to clear/set/test flags. */
# define SET(t, f) (t) |= (f)
# define CLR(t, f) (t) &= ~(f)
# define ISSET(t, f) ((t) & (f))
/*
* LFS block write function.
*