* [patch] standardising boolean variables in drivers/net (first phase)
@ 2007-10-30 8:34 Lucas Woods
2007-10-30 8:40 ` [patch] standardising boolean variables in drivers/net (first Robert P. J. Day
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Lucas Woods @ 2007-10-30 8:34 UTC (permalink / raw)
To: kernel-janitors
First patch here, be gentle, please let me know if I've made a mess of this :)
Phase 1 standardised boolean variables in drivers/net
--
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index d5d092c..f67b29b 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -491,37 +491,37 @@ enum ipg_regs {
*/
/* Miscellaneous Constants. */
-#define TRUE 1
-#define FALSE 0
+#define true 1
+#define false 0
/* Assign IPG_APPEND_FCS_ON_TX > 0 for auto FCS append on TX. */
-#define IPG_APPEND_FCS_ON_TX TRUE
+#define IPG_APPEND_FCS_ON_TX true
/* Assign IPG_APPEND_FCS_ON_TX > 0 for auto FCS strip on RX. */
-#define IPG_STRIP_FCS_ON_RX TRUE
+#define IPG_STRIP_FCS_ON_RX true
/* Assign IPG_DROP_ON_RX_ETH_ERRORS > 0 to drop RX frames with
* Ethernet errors.
*/
-#define IPG_DROP_ON_RX_ETH_ERRORS TRUE
+#define IPG_DROP_ON_RX_ETH_ERRORS true
/* Assign IPG_INSERT_MANUAL_VLAN_TAG > 0 to insert VLAN tags manually
* (via TFC).
*/
-#define IPG_INSERT_MANUAL_VLAN_TAG FALSE
+#define IPG_INSERT_MANUAL_VLAN_TAG false
/* Assign IPG_ADD_IPCHECKSUM_ON_TX > 0 for auto IP checksum on TX. */
-#define IPG_ADD_IPCHECKSUM_ON_TX FALSE
+#define IPG_ADD_IPCHECKSUM_ON_TX false
/* Assign IPG_ADD_TCPCHECKSUM_ON_TX > 0 for auto TCP checksum on TX.
* DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
*/
-#define IPG_ADD_TCPCHECKSUM_ON_TX FALSE
+#define IPG_ADD_TCPCHECKSUM_ON_TX false
/* Assign IPG_ADD_UDPCHECKSUM_ON_TX > 0 for auto UDP checksum on TX.
* DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
*/
-#define IPG_ADD_UDPCHECKSUM_ON_TX FALSE
+#define IPG_ADD_UDPCHECKSUM_ON_TX false
/* If inserting VLAN tags manually, assign the IPG_MANUAL_VLAN_xx
* constants as desired.
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index b8c0e7b..4c82b75 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -1562,7 +1562,7 @@ static int init_nic(struct s2io_nic *nic)
* if it's not complete by then we return error.
*/
time = 0;
- while (TRUE) {
+ while (true) {
val64 = readq(&bar0->tti_command_mem);
if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {
break;
@@ -1615,7 +1615,7 @@ static int init_nic(struct s2io_nic *nic)
* by then we return error.
*/
time = 0;
- while (TRUE) {
+ while (true) {
val64 = readq(&bar0->rti_command_mem);
if (!(val64 & RTI_CMD_MEM_STROBE_NEW_CMD))
break;
@@ -1986,7 +1986,7 @@ static int verify_pcc_quiescent(struct s2io_nic
*sp, int flag)
herc = (sp->device_type = XFRAME_II_DEVICE);
- if (flag = FALSE) {
+ if (flag = false) {
if ((!herc && (sp->pdev->revision >= 4)) || herc) {
if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE))
ret = 1;
@@ -3426,7 +3426,7 @@ static void s2io_reset(struct s2io_nic * sp)
/* restore the previously assigned mac address */
do_s2io_prog_unicast(sp->dev, (u8 *)&sp->def_mac_addr[0].mac_addr);
- sp->device_enabled_once = FALSE;
+ sp->device_enabled_once = false;
}
/**
@@ -5185,10 +5185,10 @@ static void s2io_ethtool_getpause_data(struct
net_device *dev,
val64 = readq(&bar0->rmac_pause_cfg);
if (val64 & RMAC_PAUSE_GEN_ENABLE)
- ep->tx_pause = TRUE;
+ ep->tx_pause = true;
if (val64 & RMAC_PAUSE_RX_ENABLE)
- ep->rx_pause = TRUE;
- ep->autoneg = FALSE;
+ ep->rx_pause = true;
+ ep->autoneg = false;
}
/**
@@ -6460,7 +6460,7 @@ static void s2io_set_link(struct work_struct *work)
val64 |= ADAPTER_LED_ON;
writeq(val64, &bar0->adapter_control);
}
- nic->device_enabled_once = TRUE;
+ nic->device_enabled_once = true;
} else {
DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name);
DBG_PRINT(ERR_DBG, "device is not Quiescent\n");
@@ -7379,7 +7379,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
pci_device_id *pre)
struct s2io_nic *sp;
struct net_device *dev;
int i, j, ret;
- int dma_flag = FALSE;
+ int dma_flag = false;
u32 mac_up, mac_down;
u64 val64 = 0, tmp64 = 0;
struct XENA_dev_config __iomem *bar0 = NULL;
@@ -7401,7 +7401,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
pci_device_id *pre)
if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");
- dma_flag = TRUE;
+ dma_flag = true;
if (pci_set_consistent_dma_mask
(pdev, DMA_64BIT_MASK)) {
DBG_PRINT(ERR_DBG,
@@ -7440,7 +7440,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
pci_device_id *pre)
sp->dev = dev;
sp->pdev = pdev;
sp->high_dma_flag = dma_flag;
- sp->device_enabled_once = FALSE;
+ sp->device_enabled_once = false;
if (rx_ring_mode = 1)
sp->rxd_mode = RXD_MODE_1;
if (rx_ring_mode = 2)
@@ -7577,7 +7577,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
pci_device_id *pre)
#endif
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
- if (sp->high_dma_flag = TRUE)
+ if (sp->high_dma_flag = true)
dev->features |= NETIF_F_HIGHDMA;
dev->features |= NETIF_F_TSO;
dev->features |= NETIF_F_TSO6;
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index cc1797a..13abd8c 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -22,9 +22,9 @@
#define BOOL int
#endif
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
+#ifndef true
+#define true 1
+#define false 0
#endif
#undef SUCCESS
diff --git a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h
index 5d940e7..b4b8398 100644
--- a/drivers/net/skfp/h/targetos.h
+++ b/drivers/net/skfp/h/targetos.h
@@ -60,8 +60,8 @@
#include "h/hwmtm.h"
-#define TRUE 1
-#define FALSE 0
+#define true 1
+#define false 0
// HWM Definitions
// -----------------------
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 7cf9b9f..e1d689c 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -273,7 +273,7 @@ static int skfp_init_one(struct pci_dev *pdev,
smc->os.dev = dev;
smc->hw.slot = -1;
smc->hw.iop = mem;
- smc->os.ResetRequested = FALSE;
+ smc->os.ResetRequested = false;
skb_queue_head_init(&smc->os.SendSkbQueue);
dev->base_addr = (unsigned long)mem;
@@ -639,7 +639,7 @@ irqreturn_t skfp_interrupt(int irq, void *dev_id)
if (smc->os.ResetRequested) {
ResetAdapter(smc);
- smc->os.ResetRequested = FALSE;
+ smc->os.ResetRequested = false;
}
spin_unlock(&bp->DriverLock);
STI_FBI(); // Enable IRQs from our adapter.
@@ -2258,7 +2258,7 @@ void drv_reset_indication(struct s_smc *smc)
{
PRINTK(KERN_INFO "entering drv_reset_indication\n");
- smc->os.ResetRequested = TRUE; // Set flag.
+ smc->os.ResetRequested = true; // Set flag.
} // drv_reset_indication
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index c99ce74..5f3a2c6 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -2236,7 +2236,7 @@ TLan_ResetAdapter( struct net_device *dev )
u32 data;
u8 data8;
- priv->tlanFullDuplex = FALSE;
+ priv->tlanFullDuplex = false;
priv->phyOnline=0;
netif_carrier_off(dev);
@@ -2291,7 +2291,7 @@ TLan_ResetAdapter( struct net_device *dev )
TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x0a );
} else if ( priv->duplex = TLAN_DUPLEX_FULL ) {
TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x00 );
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
} else {
TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x08 );
}
@@ -2672,14 +2672,14 @@ void TLan_PhyStartLink( struct net_device *dev )
TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0000);
} else if ( priv->speed = TLAN_SPEED_10 &&
priv->duplex = TLAN_DUPLEX_FULL) {
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0100);
} else if ( priv->speed = TLAN_SPEED_100 &&
priv->duplex = TLAN_DUPLEX_HALF) {
TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2000);
} else if ( priv->speed = TLAN_SPEED_100 &&
priv->duplex = TLAN_DUPLEX_FULL) {
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2100);
} else {
@@ -2716,7 +2716,7 @@ void TLan_PhyStartLink( struct net_device *dev )
tctl &= ~TLAN_TC_AUISEL;
if ( priv->duplex = TLAN_DUPLEX_FULL ) {
control |= MII_GC_DUPLEX;
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
}
if ( priv->speed = TLAN_SPEED_100 ) {
control |= MII_GC_SPEEDSEL;
@@ -2771,9 +2771,9 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev )
TLan_MiiReadReg( dev, phy, MII_AN_LPA, &an_lpa );
mode = an_adv & an_lpa & 0x03E0;
if ( mode & 0x0100 ) {
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
} else if ( ! ( mode & 0x0080 ) && ( mode & 0x0040 ) ) {
- priv->tlanFullDuplex = TRUE;
+ priv->tlanFullDuplex = true;
}
if ( ( ! ( mode & 0x0180 ) ) && ( priv->adapter->flags &
TLAN_ADAPTER_USE_INTERN_10 ) && ( priv->phyNum != 0 ) ) {
@@ -2902,7 +2902,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16
phy, u16 reg, u16 *val )
TLanPrivateInfo *priv = netdev_priv(dev);
unsigned long flags = 0;
- err = FALSE;
+ err = false;
outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
@@ -2935,7 +2935,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16
phy, u16 reg, u16 *val )
TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
}
tmp = 0xffff;
- err = TRUE;
+ err = true;
} else { /* ACK, so read data */
for (tmp = 0, i = 0x8000; i; i >>= 1) {
TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h
index 41ce0b6..52cbb2a 100644
--- a/drivers/net/tlan.h
+++ b/drivers/net/tlan.h
@@ -33,8 +33,8 @@
*
****************************************************************/
-#define FALSE 0
-#define TRUE 1
+#define false 0
+#define true 1
#define TLAN_MIN_FRAME_SIZE 64
#define TLAN_MAX_FRAME_SIZE 1600
diff --git a/drivers/net/wireless/wavelan_cs.c
b/drivers/net/wireless/wavelan_cs.c
index 577c647..58fc459 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -867,7 +867,7 @@ wv_82593_cmd(struct net_device * dev,
printk(KERN_INFO "wv_82593_cmd: %s timeout (previous command),
status 0x%02x\n",
str, status);
#endif
- return(FALSE);
+ return(false);
}
/* Issue the command to the controller */
@@ -876,10 +876,10 @@ wv_82593_cmd(struct net_device * dev,
/* If we don't have to check the result of the command
* Note : this mean that the irq handler will deal with that */
if(result = SR0_NO_RESULT)
- return(TRUE);
+ return(true);
/* We are waiting for command completion */
- wait_completed = TRUE;
+ wait_completed = true;
/* Busy wait while the LAN controller executes the command. */
spin = 1000;
@@ -904,7 +904,7 @@ wv_82593_cmd(struct net_device * dev,
!(status & SR0_RECEPTION))
{
/* Signal command completion */
- wait_completed = FALSE;
+ wait_completed = false;
}
else
{
@@ -925,7 +925,7 @@ wv_82593_cmd(struct net_device * dev,
printk(KERN_INFO "wv_82593_cmd: %s timeout, status 0x%02x\n",
str, status);
#endif
- return(FALSE);
+ return(false);
}
/* Check the return code returned by the card (see above) against
@@ -936,10 +936,10 @@ wv_82593_cmd(struct net_device * dev,
printk(KERN_INFO "wv_82593_cmd: %s failed, status = 0x%x\n",
str, status);
#endif
- return(FALSE);
+ return(false);
}
- return(TRUE);
+ return(true);
} /* wv_82593_cmd */
/*------------------------------------------------------------------*/
@@ -1009,7 +1009,7 @@ wv_82593_reconfig(struct net_device * dev)
unsigned long flags;
/* Arm the flag, will be cleard in wv_82593_config() */
- lp->reconfig_82593 = TRUE;
+ lp->reconfig_82593 = true;
/* Check if we can do it now ! */
if((link->open) && (netif_running(dev)) && !(netif_queue_stopped(dev)))
@@ -3237,7 +3237,7 @@ wv_mmc_init(struct net_device * dev)
dev->name, psa.psa_univ_mac_addr[0],
psa.psa_univ_mac_addr[1], psa.psa_univ_mac_addr[2]);
#endif
- return FALSE;
+ return false;
}
/* Get the MAC address */
@@ -3386,7 +3386,7 @@ wv_mmc_init(struct net_device * dev)
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_mmc_init()\n", dev->name);
#endif
- return TRUE;
+ return true;
}
/*------------------------------------------------------------------*/
@@ -3442,13 +3442,13 @@ wv_ru_stop(struct net_device * dev)
printk(KERN_INFO "%s: wv_ru_stop(): The chip doesn't want to stop...\n",
dev->name);
#endif
- return FALSE;
+ return false;
}
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_ru_stop()\n", dev->name);
#endif
- return TRUE;
+ return true;
} /* wv_ru_stop */
/*------------------------------------------------------------------*/
@@ -3475,7 +3475,7 @@ wv_ru_start(struct net_device * dev)
* it down. First, we disable reception (in case it was already enabled).
*/
if(!wv_ru_stop(dev))
- return FALSE;
+ return false;
spin_lock_irqsave(&lp->spinlock, flags);
@@ -3537,7 +3537,7 @@ wv_ru_start(struct net_device * dev)
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_ru_start()\n", dev->name);
#endif
- return TRUE;
+ return true;
}
/*------------------------------------------------------------------*/
@@ -3552,7 +3552,7 @@ wv_82593_config(struct net_device * dev)
kio_addr_t base = dev->base_addr;
net_local * lp = netdev_priv(dev);
struct i82593_conf_block cfblk;
- int ret = TRUE;
+ int ret = true;
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: ->wv_82593_config()\n", dev->name);
@@ -3563,17 +3563,17 @@ wv_82593_config(struct net_device * dev)
* Now conform to Wavelan document WCIN085B
*/
memset(&cfblk, 0x00, sizeof(struct i82593_conf_block));
- cfblk.d6mod = FALSE; /* Run in i82593 advanced mode */
+ cfblk.d6mod = false; /* Run in i82593 advanced mode */
cfblk.fifo_limit = 5; /* = 56 B rx and 40 B tx fifo thresholds */
- cfblk.forgnesi = FALSE; /* 0‚C501, 1=AMD7992B compatibility */
+ cfblk.forgnesi = false; /* 0‚C501, 1=AMD7992B compatibility */
cfblk.fifo_32 = 1;
- cfblk.throttle_enb = FALSE;
- cfblk.contin = TRUE; /* enable continuous mode */
- cfblk.cntrxint = FALSE; /* enable continuous mode receive interrupts */
+ cfblk.throttle_enb = false;
+ cfblk.contin = true; /* enable continuous mode */
+ cfblk.cntrxint = false; /* enable continuous mode receive interrupts */
cfblk.addr_len = WAVELAN_ADDR_SIZE;
- cfblk.acloc = TRUE; /* Disable source addr insertion by i82593 */
+ cfblk.acloc = true; /* Disable source addr insertion by i82593 */
cfblk.preamb_len = 0; /* 2 bytes preamble (SFD) */
- cfblk.loopback = FALSE;
+ cfblk.loopback = false;
cfblk.lin_prio = 0; /* conform to 802.3 backoff algorithm */
cfblk.exp_prio = 5; /* conform to 802.3 backoff algorithm */
cfblk.bof_met = 1; /* conform to 802.3 backoff algorithm */
@@ -3581,45 +3581,45 @@ wv_82593_config(struct net_device * dev)
cfblk.slottim_low = 0x20 >> 5; /* 32 bit times slot time */
cfblk.slottim_hi = 0x0;
cfblk.max_retr = 15;
- cfblk.prmisc = ((lp->promiscuous) ? TRUE: FALSE); /* Promiscuous mode */
- cfblk.bc_dis = FALSE; /* Enable broadcast reception */
- cfblk.crs_1 = TRUE; /* Transmit without carrier sense */
- cfblk.nocrc_ins = FALSE; /* i82593 generates CRC */
- cfblk.crc_1632 = FALSE; /* 32-bit Autodin-II CRC */
- cfblk.crs_cdt = FALSE; /* CD not to be interpreted as CS */
+ cfblk.prmisc = ((lp->promiscuous) ? true: false); /* Promiscuous mode */
+ cfblk.bc_dis = false; /* Enable broadcast reception */
+ cfblk.crs_1 = true; /* Transmit without carrier sense */
+ cfblk.nocrc_ins = false; /* i82593 generates CRC */
+ cfblk.crc_1632 = false; /* 32-bit Autodin-II CRC */
+ cfblk.crs_cdt = false; /* CD not to be interpreted as CS */
cfblk.cs_filter = 0; /* CS is recognized immediately */
- cfblk.crs_src = FALSE; /* External carrier sense */
+ cfblk.crs_src = false; /* External carrier sense */
cfblk.cd_filter = 0; /* CD is recognized immediately */
cfblk.min_fr_len = ETH_ZLEN >> 2; /* Minimum frame length 64 bytes */
- cfblk.lng_typ = FALSE; /* Length field > 1500 = type field */
- cfblk.lng_fld = TRUE; /* Disable 802.3 length field check */
- cfblk.rxcrc_xf = TRUE; /* Don't transfer CRC to memory */
- cfblk.artx = TRUE; /* Disable automatic retransmission */
- cfblk.sarec = TRUE; /* Disable source addr trig of CD */
- cfblk.tx_jabber = TRUE; /* Disable jabber jam sequence */
- cfblk.hash_1 = FALSE; /* Use bits 0-5 in mc address hash */
- cfblk.lbpkpol = TRUE; /* Loopback pin active high */
- cfblk.fdx = FALSE; /* Disable full duplex operation */
+ cfblk.lng_typ = false; /* Length field > 1500 = type field */
+ cfblk.lng_fld = true; /* Disable 802.3 length field check */
+ cfblk.rxcrc_xf = true; /* Don't transfer CRC to memory */
+ cfblk.artx = true; /* Disable automatic retransmission */
+ cfblk.sarec = true; /* Disable source addr trig of CD */
+ cfblk.tx_jabber = true; /* Disable jabber jam sequence */
+ cfblk.hash_1 = false; /* Use bits 0-5 in mc address hash */
+ cfblk.lbpkpol = true; /* Loopback pin active high */
+ cfblk.fdx = false; /* Disable full duplex operation */
cfblk.dummy_6 = 0x3f; /* all ones */
- cfblk.mult_ia = FALSE; /* No multiple individual addresses */
- cfblk.dis_bof = FALSE; /* Disable the backoff algorithm ?! */
- cfblk.dummy_1 = TRUE; /* set to 1 */
+ cfblk.mult_ia = false; /* No multiple individual addresses */
+ cfblk.dis_bof = false; /* Disable the backoff algorithm ?! */
+ cfblk.dummy_1 = true; /* set to 1 */
cfblk.tx_ifs_retrig = 3; /* Hmm... Disabled */
#ifdef MULTICAST_ALL
- cfblk.mc_all = (lp->allmulticast ? TRUE: FALSE); /* Allow all multicasts */
+ cfblk.mc_all = (lp->allmulticast ? true: false); /* Allow all multicasts */
#else
- cfblk.mc_all = FALSE; /* No multicast all mode */
+ cfblk.mc_all = false; /* No multicast all mode */
#endif
cfblk.rcv_mon = 0; /* Monitor mode disabled */
- cfblk.frag_acpt = TRUE; /* Do not accept fragments */
- cfblk.tstrttrs = FALSE; /* No start transmission threshold */
- cfblk.fretx = TRUE; /* FIFO automatic retransmission */
- cfblk.syncrqs = FALSE; /* Synchronous DRQ deassertion... */
- cfblk.sttlen = TRUE; /* 6 byte status registers */
- cfblk.rx_eop = TRUE; /* Signal EOP on packet reception */
- cfblk.tx_eop = TRUE; /* Signal EOP on packet transmission */
+ cfblk.frag_acpt = true; /* Do not accept fragments */
+ cfblk.tstrttrs = false; /* No start transmission threshold */
+ cfblk.fretx = true; /* FIFO automatic retransmission */
+ cfblk.syncrqs = false; /* Synchronous DRQ deassertion... */
+ cfblk.sttlen = true; /* 6 byte status registers */
+ cfblk.rx_eop = true; /* Signal EOP on packet reception */
+ cfblk.tx_eop = true; /* Signal EOP on packet transmission */
cfblk.rbuf_size = RX_SIZE>>11; /* Set receive buffer size */
- cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */
+ cfblk.rcvstop = true; /* Enable Receive Stop Register */
#ifdef DEBUG_I82593_SHOW
{
@@ -3647,7 +3647,7 @@ wv_82593_config(struct net_device * dev)
hacr_write(base, HACR_DEFAULT);
if(!wv_82593_cmd(dev, "wv_82593_config(): configure",
OP0_CONFIGURE, SR0_CONFIGURE_DONE))
- ret = FALSE;
+ ret = false;
/* Initialize adapter's ethernet MAC address */
outb(TX_BASE & 0xff, PIORL(base));
@@ -3661,7 +3661,7 @@ wv_82593_config(struct net_device * dev)
hacr_write(base, HACR_DEFAULT);
if(!wv_82593_cmd(dev, "wv_82593_config(): ia-setup",
OP0_IA_SETUP, SR0_IA_SETUP_DONE))
- ret = FALSE;
+ ret = false;
#ifdef WAVELAN_ROAMING
/* If roaming is enabled, join the "Beacon Request" multicast group... */
@@ -3698,12 +3698,12 @@ wv_82593_config(struct net_device * dev)
hacr_write(base, HACR_DEFAULT);
if(!wv_82593_cmd(dev, "wv_82593_config(): mc-setup",
OP0_MC_SETUP, SR0_MC_SETUP_DONE))
- ret = FALSE;
+ ret = false;
lp->mc_count = dev->mc_count; /* remember to avoid repeated reset */
}
/* Job done, clear the flag */
- lp->reconfig_82593 = FALSE;
+ lp->reconfig_82593 = false;
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_82593_config()\n", dev->name);
@@ -3735,7 +3735,7 @@ wv_pcmcia_reset(struct net_device * dev)
if(i != CS_SUCCESS)
{
cs_error(link, AccessConfigurationRegister, i);
- return FALSE;
+ return false;
}
#ifdef DEBUG_CONFIG_INFO
@@ -3749,7 +3749,7 @@ wv_pcmcia_reset(struct net_device * dev)
if(i != CS_SUCCESS)
{
cs_error(link, AccessConfigurationRegister, i);
- return FALSE;
+ return false;
}
reg.Action = CS_WRITE;
@@ -3758,13 +3758,13 @@ wv_pcmcia_reset(struct net_device * dev)
if(i != CS_SUCCESS)
{
cs_error(link, AccessConfigurationRegister, i);
- return FALSE;
+ return false;
}
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_pcmcia_reset()\n", dev->name);
#endif
- return TRUE;
+ return true;
}
/*------------------------------------------------------------------*/
@@ -3788,7 +3788,7 @@ wv_hw_config(struct net_device * dev)
net_local * lp = netdev_priv(dev);
kio_addr_t base = dev->base_addr;
unsigned long flags;
- int ret = FALSE;
+ int ret = false;
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: ->wv_hw_config()\n", dev->name);
@@ -3799,13 +3799,13 @@ wv_hw_config(struct net_device * dev)
{
printk(KERN_WARNING "%s: wv_hw_config: structure/compiler
botch: \"%s\"\n",
dev->name, wv_structuct_check());
- return FALSE;
+ return false;
}
#endif /* STRUCT_CHECK = 1 */
/* Reset the pcmcia interface */
- if(wv_pcmcia_reset(dev) = FALSE)
- return FALSE;
+ if(wv_pcmcia_reset(dev) = false)
+ return false;
/* Disable interrupts */
spin_lock_irqsave(&lp->spinlock, flags);
@@ -3829,7 +3829,7 @@ wv_hw_config(struct net_device * dev)
}
/* initialize the modem */
- if(wv_mmc_init(dev) = FALSE)
+ if(wv_mmc_init(dev) = false)
{
#ifdef DEBUG_CONFIG_ERRORS
printk(KERN_WARNING "%s: wv_hw_config(): Can't configure the modem\n",
@@ -3843,7 +3843,7 @@ wv_hw_config(struct net_device * dev)
mdelay(1); /* A bit crude ! */
/* Initialize the LAN controller */
- if(wv_82593_config(dev) = FALSE)
+ if(wv_82593_config(dev) = false)
{
#ifdef DEBUG_CONFIG_ERRORS
printk(KERN_INFO "%s: wv_hw_config(): i82593 init failed\n",
@@ -3853,7 +3853,7 @@ wv_hw_config(struct net_device * dev)
}
/* Diagnostic */
- if(wv_diag(dev) = FALSE)
+ if(wv_diag(dev) = false)
{
#ifdef DEBUG_CONFIG_ERRORS
printk(KERN_INFO "%s: wv_hw_config(): i82593 diagnostic failed\n",
@@ -3868,7 +3868,7 @@ wv_hw_config(struct net_device * dev)
/* The device is now configured */
lp->configured = 1;
- ret = TRUE;
+ ret = true;
}
while(0);
@@ -3902,7 +3902,7 @@ wv_hw_reset(struct net_device * dev)
lp->configured = 0;
/* Call wv_hw_config() for most of the reset & init stuff */
- if(wv_hw_config(dev) = FALSE)
+ if(wv_hw_config(dev) = false)
return;
/* start receive unit */
@@ -4020,7 +4020,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
if(i != 0)
{
wv_pcmcia_release(link);
- return FALSE;
+ return false;
}
strcpy(((net_local *) netdev_priv(dev))->node.dev_name, dev->name);
@@ -4029,7 +4029,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "<-wv_pcmcia_config()\n");
#endif
- return TRUE;
+ return true;
}
/*------------------------------------------------------------------*/
@@ -4333,7 +4333,7 @@ wavelan_watchdog(struct net_device * dev)
net_local * lp = netdev_priv(dev);
kio_addr_t base = dev->base_addr;
unsigned long flags;
- int aborted = FALSE;
+ int aborted = false;
#ifdef DEBUG_INTERRUPT_TRACE
printk(KERN_DEBUG "%s: ->wavelan_watchdog()\n", dev->name);
@@ -4352,7 +4352,7 @@ wavelan_watchdog(struct net_device * dev)
/* Wait for the end of the command (a bit hackish) */
if(wv_82593_cmd(dev, "wavelan_watchdog(): abort",
OP0_NOP | CR0_STATUS_3, SR0_EXECUTION_ABORTED))
- aborted = TRUE;
+ aborted = true;
/* Release spinlock here so that wv_hw_reset() can grab it */
spin_unlock_irqrestore(&lp->spinlock, flags);
@@ -4427,13 +4427,13 @@ wavelan_open(struct net_device * dev)
printk(KERN_WARNING "%s: wavelan_open(): modem not connected\n",
dev->name);
#endif
- return FALSE;
+ return false;
}
}
/* Start reception and declare the driver ready */
if(!lp->configured)
- return FALSE;
+ return false;
if(!wv_ru_start(dev))
wv_hw_reset(dev); /* If problem : reset */
netif_start_queue(dev);
@@ -4549,7 +4549,7 @@ wavelan_probe(struct pcmcia_device *p_dev)
/* Init specific data */
lp->configured = 0;
- lp->reconfig_82593 = FALSE;
+ lp->reconfig_82593 = false;
lp->nresets = 0;
/* Multicast stuff */
lp->promiscuous = 0;
diff --git a/drivers/net/wireless/wavelan_cs.h
b/drivers/net/wireless/wavelan_cs.h
index fabc63e..cf78b35 100644
--- a/drivers/net/wireless/wavelan_cs.h
+++ b/drivers/net/wireless/wavelan_cs.h
@@ -151,8 +151,8 @@ static const int fixed_bands[] = { 915e6, 2.425e8,
2.46e8, 2.484e8, 2.4305e8 };
#define RX_SIZE (TX_BASE-RX_BASE) /* Size of receive area */
#define RX_SIZE_SHIFT 6 /* Bits to shift in stop register */
-#define TRUE 1
-#define FALSE 0
+#define true 1
+#define false 0
#define MOD_ENAL 1
#define MOD_PROM 2
-
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch] standardising boolean variables in drivers/net (first
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
@ 2007-10-30 8:40 ` Robert P. J. Day
2007-10-30 12:17 ` Arnaldo Carvalho de Melo
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Robert P. J. Day @ 2007-10-30 8:40 UTC (permalink / raw)
To: kernel-janitors
you should include the subsystem against which this patch applies in
the subject, as in:
[PATCH] NET: standardizing ...
and you should also CC that mailing list or maintainer of that
subsystem.
also, if this is to be the first of many related patches, you might
consider doing a multi-part patch.
On Tue, 30 Oct 2007, Lucas Woods wrote:
> First patch here, be gentle, please let me know if I've made a mess of this :)
>
>
> Phase 1 standardised boolean variables in drivers/net
>
> --
> diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
> index d5d092c..f67b29b 100644
> --- a/drivers/net/ipg.h
> +++ b/drivers/net/ipg.h
> @@ -491,37 +491,37 @@ enum ipg_regs {
> */
>
> /* Miscellaneous Constants. */
> -#define TRUE 1
> -#define FALSE 0
> +#define true 1
> +#define false 0
there should be no need to define the symbols "true" and "false" as
they should be predefined for variables of type "bool".
> @@ -7379,7 +7379,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
> pci_device_id *pre)
> struct s2io_nic *sp;
> struct net_device *dev;
> int i, j, ret;
> - int dma_flag = FALSE;
> + int dma_flag = false;
if a variable is truly going to represent just boolean values, you
might consider redeclaring it as "bool" instead of "int".
rday
--
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://crashcourse.ca
====================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] standardising boolean variables in drivers/net (first
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
2007-10-30 8:40 ` [patch] standardising boolean variables in drivers/net (first Robert P. J. Day
@ 2007-10-30 12:17 ` Arnaldo Carvalho de Melo
2007-10-30 14:30 ` Richard Knutsson
2007-10-30 14:52 ` Richard Knutsson
3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-10-30 12:17 UTC (permalink / raw)
To: kernel-janitors
Em Tue, Oct 30, 2007 at 07:34:04PM +1100, Lucas Woods escreveu:
> First patch here, be gentle, please let me know if I've made a mess of this :)
>
>
> Phase 1 standardised boolean variables in drivers/net
>
> --
> diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
> index d5d092c..f67b29b 100644
> --- a/drivers/net/ipg.h
> +++ b/drivers/net/ipg.h
> @@ -491,37 +491,37 @@ enum ipg_regs {
> */
>
> /* Miscellaneous Constants. */
> -#define TRUE 1
> -#define FALSE 0
> +#define true 1
> +#define false 0
You don't need to define 'true' and 'false', they are already defined in
include/linux/stddef.h
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] standardising boolean variables in drivers/net (first
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
2007-10-30 8:40 ` [patch] standardising boolean variables in drivers/net (first Robert P. J. Day
2007-10-30 12:17 ` Arnaldo Carvalho de Melo
@ 2007-10-30 14:30 ` Richard Knutsson
2007-10-30 14:52 ` Richard Knutsson
3 siblings, 0 replies; 5+ messages in thread
From: Richard Knutsson @ 2007-10-30 14:30 UTC (permalink / raw)
To: kernel-janitors
Robert P. J. Day wrote:
> you should include the subsystem against which this patch applies in
> the subject, as in:
>
> [PATCH] NET: standardizing ...
>
> and you should also CC that mailing list or maintainer of that
> subsystem.
>
> also, if this is to be the first of many related patches, you might
> consider doing a multi-part patch.
>
> On Tue, 30 Oct 2007, Lucas Woods wrote:
>
>
>> First patch here, be gentle, please let me know if I've made a mess of this :)
>>
>>
>> Phase 1 standardised boolean variables in drivers/net
>>
>> --
>> diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
>> index d5d092c..f67b29b 100644
>> --- a/drivers/net/ipg.h
>> +++ b/drivers/net/ipg.h
>> @@ -491,37 +491,37 @@ enum ipg_regs {
>> */
>>
>> /* Miscellaneous Constants. */
>> -#define TRUE 1
>> -#define FALSE 0
>> +#define true 1
>> +#define false 0
>>
>
> there should be no need to define the symbols "true" and "false" as
> they should be predefined for variables of type "bool".
>
>
>> @@ -7379,7 +7379,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
>> pci_device_id *pre)
>> struct s2io_nic *sp;
>> struct net_device *dev;
>> int i, j, ret;
>> - int dma_flag = FALSE;
>> + int dma_flag = false;
>>
>
> if a variable is truly going to represent just boolean values, you
> might consider redeclaring it as "bool" instead of "int".
>
+ if you are changing the type of the variable/(return of a function),
it is a good idea to check all instances of it to secure it as a boolean
and not a multi-state variable. Also it gives you the opportunity to see
if it still is needed (or only assigned values and never used).
thanks
Richard Knutsson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] standardising boolean variables in drivers/net (first
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
` (2 preceding siblings ...)
2007-10-30 14:30 ` Richard Knutsson
@ 2007-10-30 14:52 ` Richard Knutsson
3 siblings, 0 replies; 5+ messages in thread
From: Richard Knutsson @ 2007-10-30 14:52 UTC (permalink / raw)
To: kernel-janitors
Lucas Woods wrote:
> First patch here, be gentle, please let me know if I've made a mess of this :)
>
>
> Phase 1 standardised boolean variables in drivers/net
>
> --
> diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
> index d5d092c..f67b29b 100644
> --- a/drivers/net/ipg.h
> +++ b/drivers/net/ipg.h
> @@ -491,37 +491,37 @@ enum ipg_regs {
> */
>
> /* Miscellaneous Constants. */
> -#define TRUE 1
> -#define FALSE 0
> +#define true 1
> +#define false 0
>
> /* Assign IPG_APPEND_FCS_ON_TX > 0 for auto FCS append on TX. */
> -#define IPG_APPEND_FCS_ON_TX TRUE
> +#define IPG_APPEND_FCS_ON_TX true
>
> /* Assign IPG_APPEND_FCS_ON_TX > 0 for auto FCS strip on RX. */
> -#define IPG_STRIP_FCS_ON_RX TRUE
> +#define IPG_STRIP_FCS_ON_RX true
>
> /* Assign IPG_DROP_ON_RX_ETH_ERRORS > 0 to drop RX frames with
> * Ethernet errors.
> */
> -#define IPG_DROP_ON_RX_ETH_ERRORS TRUE
> +#define IPG_DROP_ON_RX_ETH_ERRORS true
>
> /* Assign IPG_INSERT_MANUAL_VLAN_TAG > 0 to insert VLAN tags manually
> * (via TFC).
> */
> -#define IPG_INSERT_MANUAL_VLAN_TAG FALSE
> +#define IPG_INSERT_MANUAL_VLAN_TAG false
>
> /* Assign IPG_ADD_IPCHECKSUM_ON_TX > 0 for auto IP checksum on TX. */
> -#define IPG_ADD_IPCHECKSUM_ON_TX FALSE
> +#define IPG_ADD_IPCHECKSUM_ON_TX false
>
> /* Assign IPG_ADD_TCPCHECKSUM_ON_TX > 0 for auto TCP checksum on TX.
> * DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
> */
> -#define IPG_ADD_TCPCHECKSUM_ON_TX FALSE
> +#define IPG_ADD_TCPCHECKSUM_ON_TX false
>
> /* Assign IPG_ADD_UDPCHECKSUM_ON_TX > 0 for auto UDP checksum on TX.
> * DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
> */
> -#define IPG_ADD_UDPCHECKSUM_ON_TX FALSE
> +#define IPG_ADD_UDPCHECKSUM_ON_TX false
>
> /* If inserting VLAN tags manually, assign the IPG_MANUAL_VLAN_xx
> * constants as desired.
> diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
> index b8c0e7b..4c82b75 100644
> --- a/drivers/net/s2io.c
> +++ b/drivers/net/s2io.c
> @@ -1562,7 +1562,7 @@ static int init_nic(struct s2io_nic *nic)
> * if it's not complete by then we return error.
> */
> time = 0;
> - while (TRUE) {
> + while (true) {
> val64 = readq(&bar0->tti_command_mem);
> if (!(val64 & TTI_CMD_MEM_STROBE_NEW_CMD)) {
> break;
> @@ -1615,7 +1615,7 @@ static int init_nic(struct s2io_nic *nic)
> * by then we return error.
> */
> time = 0;
> - while (TRUE) {
> + while (true) {
> val64 = readq(&bar0->rti_command_mem);
> if (!(val64 & RTI_CMD_MEM_STROBE_NEW_CMD))
> break;
> @@ -1986,7 +1986,7 @@ static int verify_pcc_quiescent(struct s2io_nic
> *sp, int flag)
>
> herc = (sp->device_type = XFRAME_II_DEVICE);
>
> - if (flag = FALSE) {
> + if (flag = false) {
>
Since it is a boolean, the 'not'-operand is more appropriate, so: "if
(!flag) {"
> if ((!herc && (sp->pdev->revision >= 4)) || herc) {
> if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE))
> ret = 1;
> @@ -3426,7 +3426,7 @@ static void s2io_reset(struct s2io_nic * sp)
> /* restore the previously assigned mac address */
> do_s2io_prog_unicast(sp->dev, (u8 *)&sp->def_mac_addr[0].mac_addr);
>
> - sp->device_enabled_once = FALSE;
> + sp->device_enabled_once = false;
> }
>
> /**
> @@ -5185,10 +5185,10 @@ static void s2io_ethtool_getpause_data(struct
> net_device *dev,
>
> val64 = readq(&bar0->rmac_pause_cfg);
> if (val64 & RMAC_PAUSE_GEN_ENABLE)
> - ep->tx_pause = TRUE;
> + ep->tx_pause = true;
> if (val64 & RMAC_PAUSE_RX_ENABLE)
> - ep->rx_pause = TRUE;
> - ep->autoneg = FALSE;
> + ep->rx_pause = true;
> + ep->autoneg = false;
> }
>
> /**
> @@ -6460,7 +6460,7 @@ static void s2io_set_link(struct work_struct *work)
> val64 |= ADAPTER_LED_ON;
> writeq(val64, &bar0->adapter_control);
> }
> - nic->device_enabled_once = TRUE;
> + nic->device_enabled_once = true;
> } else {
> DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name);
> DBG_PRINT(ERR_DBG, "device is not Quiescent\n");
> @@ -7379,7 +7379,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
> pci_device_id *pre)
> struct s2io_nic *sp;
> struct net_device *dev;
> int i, j, ret;
> - int dma_flag = FALSE;
> + int dma_flag = false;
> u32 mac_up, mac_down;
> u64 val64 = 0, tmp64 = 0;
> struct XENA_dev_config __iomem *bar0 = NULL;
> @@ -7401,7 +7401,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
> pci_device_id *pre)
>
> if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
> DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");
> - dma_flag = TRUE;
> + dma_flag = true;
> if (pci_set_consistent_dma_mask
> (pdev, DMA_64BIT_MASK)) {
> DBG_PRINT(ERR_DBG,
> @@ -7440,7 +7440,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
> pci_device_id *pre)
> sp->dev = dev;
> sp->pdev = pdev;
> sp->high_dma_flag = dma_flag;
> - sp->device_enabled_once = FALSE;
> + sp->device_enabled_once = false;
> if (rx_ring_mode = 1)
> sp->rxd_mode = RXD_MODE_1;
> if (rx_ring_mode = 2)
> @@ -7577,7 +7577,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
> pci_device_id *pre)
> #endif
>
> dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
> - if (sp->high_dma_flag = TRUE)
> + if (sp->high_dma_flag = true)
>
if (sp->high_dma_flag)
> dev->features |= NETIF_F_HIGHDMA;
> dev->features |= NETIF_F_TSO;
> dev->features |= NETIF_F_TSO6;
> diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
> index cc1797a..13abd8c 100644
> --- a/drivers/net/s2io.h
> +++ b/drivers/net/s2io.h
> @@ -22,9 +22,9 @@
> #define BOOL int
> #endif
>
Why not also take care of the variables of the type 'BOOL'?
> -#ifndef TRUE
> -#define TRUE 1
> -#define FALSE 0
> +#ifndef true
> +#define true 1
> +#define false 0
> #endif
>
> #undef SUCCESS
> diff --git a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h
> index 5d940e7..b4b8398 100644
> --- a/drivers/net/skfp/h/targetos.h
> +++ b/drivers/net/skfp/h/targetos.h
> @@ -60,8 +60,8 @@
>
> #include "h/hwmtm.h"
>
> -#define TRUE 1
> -#define FALSE 0
> +#define true 1
> +#define false 0
>
> // HWM Definitions
> // -----------------------
> diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
> index 7cf9b9f..e1d689c 100644
> --- a/drivers/net/skfp/skfddi.c
> +++ b/drivers/net/skfp/skfddi.c
> @@ -273,7 +273,7 @@ static int skfp_init_one(struct pci_dev *pdev,
> smc->os.dev = dev;
> smc->hw.slot = -1;
> smc->hw.iop = mem;
> - smc->os.ResetRequested = FALSE;
> + smc->os.ResetRequested = false;
> skb_queue_head_init(&smc->os.SendSkbQueue);
>
> dev->base_addr = (unsigned long)mem;
> @@ -639,7 +639,7 @@ irqreturn_t skfp_interrupt(int irq, void *dev_id)
>
> if (smc->os.ResetRequested) {
> ResetAdapter(smc);
> - smc->os.ResetRequested = FALSE;
> + smc->os.ResetRequested = false;
> }
> spin_unlock(&bp->DriverLock);
> STI_FBI(); // Enable IRQs from our adapter.
> @@ -2258,7 +2258,7 @@ void drv_reset_indication(struct s_smc *smc)
> {
> PRINTK(KERN_INFO "entering drv_reset_indication\n");
>
> - smc->os.ResetRequested = TRUE; // Set flag.
> + smc->os.ResetRequested = true; // Set flag.
>
> } // drv_reset_indication
>
> diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
> index c99ce74..5f3a2c6 100644
> --- a/drivers/net/tlan.c
> +++ b/drivers/net/tlan.c
> @@ -2236,7 +2236,7 @@ TLan_ResetAdapter( struct net_device *dev )
> u32 data;
> u8 data8;
>
> - priv->tlanFullDuplex = FALSE;
> + priv->tlanFullDuplex = false;
> priv->phyOnline=0;
> netif_carrier_off(dev);
>
> @@ -2291,7 +2291,7 @@ TLan_ResetAdapter( struct net_device *dev )
> TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x0a );
> } else if ( priv->duplex = TLAN_DUPLEX_FULL ) {
> TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x00 );
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> } else {
> TLan_DioWrite8( dev->base_addr, TLAN_ACOMMIT, 0x08 );
> }
> @@ -2672,14 +2672,14 @@ void TLan_PhyStartLink( struct net_device *dev )
> TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0000);
> } else if ( priv->speed = TLAN_SPEED_10 &&
> priv->duplex = TLAN_DUPLEX_FULL) {
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x0100);
> } else if ( priv->speed = TLAN_SPEED_100 &&
> priv->duplex = TLAN_DUPLEX_HALF) {
> TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2000);
> } else if ( priv->speed = TLAN_SPEED_100 &&
> priv->duplex = TLAN_DUPLEX_FULL) {
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> TLan_MiiWriteReg( dev, phy, MII_GEN_CTL, 0x2100);
> } else {
>
> @@ -2716,7 +2716,7 @@ void TLan_PhyStartLink( struct net_device *dev )
> tctl &= ~TLAN_TC_AUISEL;
> if ( priv->duplex = TLAN_DUPLEX_FULL ) {
> control |= MII_GC_DUPLEX;
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> }
> if ( priv->speed = TLAN_SPEED_100 ) {
> control |= MII_GC_SPEEDSEL;
> @@ -2771,9 +2771,9 @@ void TLan_PhyFinishAutoNeg( struct net_device *dev )
> TLan_MiiReadReg( dev, phy, MII_AN_LPA, &an_lpa );
> mode = an_adv & an_lpa & 0x03E0;
> if ( mode & 0x0100 ) {
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> } else if ( ! ( mode & 0x0080 ) && ( mode & 0x0040 ) ) {
> - priv->tlanFullDuplex = TRUE;
> + priv->tlanFullDuplex = true;
> }
>
> if ( ( ! ( mode & 0x0180 ) ) && ( priv->adapter->flags &
> TLAN_ADAPTER_USE_INTERN_10 ) && ( priv->phyNum != 0 ) ) {
> @@ -2902,7 +2902,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16
> phy, u16 reg, u16 *val )
> TLanPrivateInfo *priv = netdev_priv(dev);
> unsigned long flags = 0;
>
> - err = FALSE;
> + err = false;
> outw(TLAN_NET_SIO, dev->base_addr + TLAN_DIO_ADR);
> sio = dev->base_addr + TLAN_DIO_DATA + TLAN_NET_SIO;
>
> @@ -2935,7 +2935,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16
> phy, u16 reg, u16 *val )
> TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
> }
> tmp = 0xffff;
> - err = TRUE;
> + err = true;
> } else { /* ACK, so read data */
> for (tmp = 0, i = 0x8000; i; i >>= 1) {
> TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
> diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h
> index 41ce0b6..52cbb2a 100644
> --- a/drivers/net/tlan.h
> +++ b/drivers/net/tlan.h
> @@ -33,8 +33,8 @@
> *
> ****************************************************************/
>
> -#define FALSE 0
> -#define TRUE 1
> +#define false 0
> +#define true 1
>
> #define TLAN_MIN_FRAME_SIZE 64
> #define TLAN_MAX_FRAME_SIZE 1600
> diff --git a/drivers/net/wireless/wavelan_cs.c
> b/drivers/net/wireless/wavelan_cs.c
> index 577c647..58fc459 100644
> --- a/drivers/net/wireless/wavelan_cs.c
> +++ b/drivers/net/wireless/wavelan_cs.c
> @@ -867,7 +867,7 @@ wv_82593_cmd(struct net_device * dev,
> printk(KERN_INFO "wv_82593_cmd: %s timeout (previous command),
> status 0x%02x\n",
> str, status);
> #endif
> - return(FALSE);
> + return(false);
> }
>
> /* Issue the command to the controller */
> @@ -876,10 +876,10 @@ wv_82593_cmd(struct net_device * dev,
> /* If we don't have to check the result of the command
> * Note : this mean that the irq handler will deal with that */
> if(result = SR0_NO_RESULT)
> - return(TRUE);
> + return(true);
>
> /* We are waiting for command completion */
> - wait_completed = TRUE;
> + wait_completed = true;
>
> /* Busy wait while the LAN controller executes the command. */
> spin = 1000;
> @@ -904,7 +904,7 @@ wv_82593_cmd(struct net_device * dev,
> !(status & SR0_RECEPTION))
> {
> /* Signal command completion */
> - wait_completed = FALSE;
> + wait_completed = false;
> }
> else
> {
> @@ -925,7 +925,7 @@ wv_82593_cmd(struct net_device * dev,
> printk(KERN_INFO "wv_82593_cmd: %s timeout, status 0x%02x\n",
> str, status);
> #endif
> - return(FALSE);
> + return(false);
> }
>
> /* Check the return code returned by the card (see above) against
> @@ -936,10 +936,10 @@ wv_82593_cmd(struct net_device * dev,
> printk(KERN_INFO "wv_82593_cmd: %s failed, status = 0x%x\n",
> str, status);
> #endif
> - return(FALSE);
> + return(false);
> }
>
> - return(TRUE);
> + return(true);
> } /* wv_82593_cmd */
>
> /*------------------------------------------------------------------*/
> @@ -1009,7 +1009,7 @@ wv_82593_reconfig(struct net_device * dev)
> unsigned long flags;
>
> /* Arm the flag, will be cleard in wv_82593_config() */
> - lp->reconfig_82593 = TRUE;
> + lp->reconfig_82593 = true;
>
> /* Check if we can do it now ! */
> if((link->open) && (netif_running(dev)) && !(netif_queue_stopped(dev)))
> @@ -3237,7 +3237,7 @@ wv_mmc_init(struct net_device * dev)
> dev->name, psa.psa_univ_mac_addr[0],
> psa.psa_univ_mac_addr[1], psa.psa_univ_mac_addr[2]);
> #endif
> - return FALSE;
> + return false;
> }
>
> /* Get the MAC address */
> @@ -3386,7 +3386,7 @@ wv_mmc_init(struct net_device * dev)
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: <-wv_mmc_init()\n", dev->name);
> #endif
> - return TRUE;
> + return true;
> }
>
> /*------------------------------------------------------------------*/
> @@ -3442,13 +3442,13 @@ wv_ru_stop(struct net_device * dev)
> printk(KERN_INFO "%s: wv_ru_stop(): The chip doesn't want to stop...\n",
> dev->name);
> #endif
> - return FALSE;
> + return false;
> }
>
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: <-wv_ru_stop()\n", dev->name);
> #endif
> - return TRUE;
> + return true;
> } /* wv_ru_stop */
>
> /*------------------------------------------------------------------*/
> @@ -3475,7 +3475,7 @@ wv_ru_start(struct net_device * dev)
> * it down. First, we disable reception (in case it was already enabled).
> */
> if(!wv_ru_stop(dev))
> - return FALSE;
> + return false;
>
> spin_lock_irqsave(&lp->spinlock, flags);
>
> @@ -3537,7 +3537,7 @@ wv_ru_start(struct net_device * dev)
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: <-wv_ru_start()\n", dev->name);
> #endif
> - return TRUE;
> + return true;
> }
>
> /*------------------------------------------------------------------*/
> @@ -3552,7 +3552,7 @@ wv_82593_config(struct net_device * dev)
> kio_addr_t base = dev->base_addr;
> net_local * lp = netdev_priv(dev);
> struct i82593_conf_block cfblk;
> - int ret = TRUE;
> + int ret = true;
>
bool?
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: ->wv_82593_config()\n", dev->name);
> @@ -3563,17 +3563,17 @@ wv_82593_config(struct net_device * dev)
> * Now conform to Wavelan document WCIN085B
> */
> memset(&cfblk, 0x00, sizeof(struct i82593_conf_block));
> - cfblk.d6mod = FALSE; /* Run in i82593 advanced mode */
> + cfblk.d6mod = false; /* Run in i82593 advanced mode */
> cfblk.fifo_limit = 5; /* = 56 B rx and 40 B tx fifo thresholds */
> - cfblk.forgnesi = FALSE; /* 0‚C501, 1=AMD7992B compatibility */
> + cfblk.forgnesi = false; /* 0‚C501, 1=AMD7992B compatibility */
> cfblk.fifo_32 = 1;
> - cfblk.throttle_enb = FALSE;
> - cfblk.contin = TRUE; /* enable continuous mode */
> - cfblk.cntrxint = FALSE; /* enable continuous mode receive interrupts */
> + cfblk.throttle_enb = false;
> + cfblk.contin = true; /* enable continuous mode */
> + cfblk.cntrxint = false; /* enable continuous mode receive interrupts */
> cfblk.addr_len = WAVELAN_ADDR_SIZE;
> - cfblk.acloc = TRUE; /* Disable source addr insertion by i82593 */
> + cfblk.acloc = true; /* Disable source addr insertion by i82593 */
> cfblk.preamb_len = 0; /* 2 bytes preamble (SFD) */
> - cfblk.loopback = FALSE;
> + cfblk.loopback = false;
> cfblk.lin_prio = 0; /* conform to 802.3 backoff algorithm */
> cfblk.exp_prio = 5; /* conform to 802.3 backoff algorithm */
> cfblk.bof_met = 1; /* conform to 802.3 backoff algorithm */
> @@ -3581,45 +3581,45 @@ wv_82593_config(struct net_device * dev)
> cfblk.slottim_low = 0x20 >> 5; /* 32 bit times slot time */
> cfblk.slottim_hi = 0x0;
> cfblk.max_retr = 15;
> - cfblk.prmisc = ((lp->promiscuous) ? TRUE: FALSE); /* Promiscuous mode */
> - cfblk.bc_dis = FALSE; /* Enable broadcast reception */
> - cfblk.crs_1 = TRUE; /* Transmit without carrier sense */
> - cfblk.nocrc_ins = FALSE; /* i82593 generates CRC */
> - cfblk.crc_1632 = FALSE; /* 32-bit Autodin-II CRC */
> - cfblk.crs_cdt = FALSE; /* CD not to be interpreted as CS */
> + cfblk.prmisc = ((lp->promiscuous) ? true: false); /* Promiscuous mode */
>
if lp->promiscuous is a bool, why not assign it as-is? Otherwise I think
it would be "correct" to write 'cfblk.prmisc = lp->promiscuous != 0'
since that is the evaluation from the if-statement.
> + cfblk.bc_dis = false; /* Enable broadcast reception */
> + cfblk.crs_1 = true; /* Transmit without carrier sense */
> + cfblk.nocrc_ins = false; /* i82593 generates CRC */
> + cfblk.crc_1632 = false; /* 32-bit Autodin-II CRC */
> + cfblk.crs_cdt = false; /* CD not to be interpreted as CS */
> cfblk.cs_filter = 0; /* CS is recognized immediately */
> - cfblk.crs_src = FALSE; /* External carrier sense */
> + cfblk.crs_src = false; /* External carrier sense */
> cfblk.cd_filter = 0; /* CD is recognized immediately */
> cfblk.min_fr_len = ETH_ZLEN >> 2; /* Minimum frame length 64 bytes */
> - cfblk.lng_typ = FALSE; /* Length field > 1500 = type field */
> - cfblk.lng_fld = TRUE; /* Disable 802.3 length field check */
> - cfblk.rxcrc_xf = TRUE; /* Don't transfer CRC to memory */
> - cfblk.artx = TRUE; /* Disable automatic retransmission */
> - cfblk.sarec = TRUE; /* Disable source addr trig of CD */
> - cfblk.tx_jabber = TRUE; /* Disable jabber jam sequence */
> - cfblk.hash_1 = FALSE; /* Use bits 0-5 in mc address hash */
> - cfblk.lbpkpol = TRUE; /* Loopback pin active high */
> - cfblk.fdx = FALSE; /* Disable full duplex operation */
> + cfblk.lng_typ = false; /* Length field > 1500 = type field */
> + cfblk.lng_fld = true; /* Disable 802.3 length field check */
> + cfblk.rxcrc_xf = true; /* Don't transfer CRC to memory */
> + cfblk.artx = true; /* Disable automatic retransmission */
> + cfblk.sarec = true; /* Disable source addr trig of CD */
> + cfblk.tx_jabber = true; /* Disable jabber jam sequence */
> + cfblk.hash_1 = false; /* Use bits 0-5 in mc address hash */
> + cfblk.lbpkpol = true; /* Loopback pin active high */
> + cfblk.fdx = false; /* Disable full duplex operation */
> cfblk.dummy_6 = 0x3f; /* all ones */
> - cfblk.mult_ia = FALSE; /* No multiple individual addresses */
> - cfblk.dis_bof = FALSE; /* Disable the backoff algorithm ?! */
> - cfblk.dummy_1 = TRUE; /* set to 1 */
> + cfblk.mult_ia = false; /* No multiple individual addresses */
> + cfblk.dis_bof = false; /* Disable the backoff algorithm ?! */
> + cfblk.dummy_1 = true; /* set to 1 */
> cfblk.tx_ifs_retrig = 3; /* Hmm... Disabled */
> #ifdef MULTICAST_ALL
> - cfblk.mc_all = (lp->allmulticast ? TRUE: FALSE); /* Allow all multicasts */
> + cfblk.mc_all = (lp->allmulticast ? true: false); /* Allow all multicasts */
>
Same here..
> #else
> - cfblk.mc_all = FALSE; /* No multicast all mode */
> + cfblk.mc_all = false; /* No multicast all mode */
> #endif
> cfblk.rcv_mon = 0; /* Monitor mode disabled */
> - cfblk.frag_acpt = TRUE; /* Do not accept fragments */
> - cfblk.tstrttrs = FALSE; /* No start transmission threshold */
> - cfblk.fretx = TRUE; /* FIFO automatic retransmission */
> - cfblk.syncrqs = FALSE; /* Synchronous DRQ deassertion... */
> - cfblk.sttlen = TRUE; /* 6 byte status registers */
> - cfblk.rx_eop = TRUE; /* Signal EOP on packet reception */
> - cfblk.tx_eop = TRUE; /* Signal EOP on packet transmission */
> + cfblk.frag_acpt = true; /* Do not accept fragments */
> + cfblk.tstrttrs = false; /* No start transmission threshold */
> + cfblk.fretx = true; /* FIFO automatic retransmission */
> + cfblk.syncrqs = false; /* Synchronous DRQ deassertion... */
> + cfblk.sttlen = true; /* 6 byte status registers */
> + cfblk.rx_eop = true; /* Signal EOP on packet reception */
> + cfblk.tx_eop = true; /* Signal EOP on packet transmission */
> cfblk.rbuf_size = RX_SIZE>>11; /* Set receive buffer size */
> - cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */
> + cfblk.rcvstop = true; /* Enable Receive Stop Register */
>
Is all of there booleans?
> #ifdef DEBUG_I82593_SHOW
> {
> @@ -3647,7 +3647,7 @@ wv_82593_config(struct net_device * dev)
> hacr_write(base, HACR_DEFAULT);
> if(!wv_82593_cmd(dev, "wv_82593_config(): configure",
> OP0_CONFIGURE, SR0_CONFIGURE_DONE))
> - ret = FALSE;
> + ret = false;
>
> /* Initialize adapter's ethernet MAC address */
> outb(TX_BASE & 0xff, PIORL(base));
> @@ -3661,7 +3661,7 @@ wv_82593_config(struct net_device * dev)
> hacr_write(base, HACR_DEFAULT);
> if(!wv_82593_cmd(dev, "wv_82593_config(): ia-setup",
> OP0_IA_SETUP, SR0_IA_SETUP_DONE))
> - ret = FALSE;
> + ret = false;
>
> #ifdef WAVELAN_ROAMING
> /* If roaming is enabled, join the "Beacon Request" multicast group... */
> @@ -3698,12 +3698,12 @@ wv_82593_config(struct net_device * dev)
> hacr_write(base, HACR_DEFAULT);
> if(!wv_82593_cmd(dev, "wv_82593_config(): mc-setup",
> OP0_MC_SETUP, SR0_MC_SETUP_DONE))
> - ret = FALSE;
> + ret = false;
> lp->mc_count = dev->mc_count; /* remember to avoid repeated reset */
> }
>
> /* Job done, clear the flag */
> - lp->reconfig_82593 = FALSE;
> + lp->reconfig_82593 = false;
>
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: <-wv_82593_config()\n", dev->name);
> @@ -3735,7 +3735,7 @@ wv_pcmcia_reset(struct net_device * dev)
> if(i != CS_SUCCESS)
> {
> cs_error(link, AccessConfigurationRegister, i);
> - return FALSE;
> + return false;
> }
>
> #ifdef DEBUG_CONFIG_INFO
> @@ -3749,7 +3749,7 @@ wv_pcmcia_reset(struct net_device * dev)
> if(i != CS_SUCCESS)
> {
> cs_error(link, AccessConfigurationRegister, i);
> - return FALSE;
> + return false;
> }
>
> reg.Action = CS_WRITE;
> @@ -3758,13 +3758,13 @@ wv_pcmcia_reset(struct net_device * dev)
> if(i != CS_SUCCESS)
> {
> cs_error(link, AccessConfigurationRegister, i);
> - return FALSE;
> + return false;
> }
>
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: <-wv_pcmcia_reset()\n", dev->name);
> #endif
> - return TRUE;
> + return true;
> }
>
> /*------------------------------------------------------------------*/
> @@ -3788,7 +3788,7 @@ wv_hw_config(struct net_device * dev)
> net_local * lp = netdev_priv(dev);
> kio_addr_t base = dev->base_addr;
> unsigned long flags;
> - int ret = FALSE;
> + int ret = false;
>
> #ifdef DEBUG_CONFIG_TRACE
> printk(KERN_DEBUG "%s: ->wv_hw_config()\n", dev->name);
> @@ -3799,13 +3799,13 @@ wv_hw_config(struct net_device * dev)
> {
> printk(KERN_WARNING "%s: wv_hw_config: structure/compiler
> botch: \"%s\"\n",
> dev->name, wv_structuct_check());
> - return FALSE;
> + return false;
> }
> #endif /* STRUCT_CHECK = 1 */
>
> /* Reset the pcmcia interface */
> - if(wv_pcmcia_reset(dev) = FALSE)
> - return FALSE;
> + if(wv_pcmcia_reset(dev) = false)
> + return false;
>
Apart from the "= false", is wv_pcmcia_reset() returning a boolean?
Alright, "snipping" the rest of the mail. Seems that you have made a
"s/FALSE/false" conversion. I am bit confused that you could compile
with the "#define false", did it not even warn about it?
(btw, please try the script/checkpatch.pl on your patches, since it
promotes style-improvements on the lines your patch effects).
cu
Richard Knutsson
-
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-30 14:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
2007-10-30 8:40 ` [patch] standardising boolean variables in drivers/net (first Robert P. J. Day
2007-10-30 12:17 ` Arnaldo Carvalho de Melo
2007-10-30 14:30 ` Richard Knutsson
2007-10-30 14:52 ` Richard Knutsson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.