Detected using sparse.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
outb(PKT_BUF_SZ >> 8, nic->ioaddr + TxFreeThreshold); /* Room for a packet. */
/* Clear the Tx ring. */
for (i = 0; i < TX_RING_SIZE; i++)
- vp->tx_skbuff[i] = 0;
+ vp->tx_skbuff[i] = NULL;
outl(0, nic->ioaddr + DownListPtr);
}
/* Set receiver mode: presumably accept b-case and phys addr only. */
i = vx_connector; /* default in EEPROM */
reason = "default";
- warning = 0;
+ warning = NULL;
if ((vx_connectors & conn_tab[vx_connector].bit) == 0) {
warning = "strange connector type in EEPROM.";
i = CONNECTOR_UTP;
}
- if (warning != 0) {
+ if (warning) {
printf("warning: %s\n", warning);
}
printf("selected %s. (%s)\n", conn_tab[i].name, reason);
struct bnx2 *bp = &bnx2;
int i, rc;
- if (pdev == 0)
- return 0;
-
memset(bp, 0, sizeof(*bp));
rc = bnx2_init_board(pdev, nic);
}
else {
/* write to the INT_ACK register */
- falcon_writel ( efab, 0, FCN_INT_ACK_KER_REG_A1 );
+ EFAB_ZERO_DWORD ( reg );
+ falcon_writel ( efab, ®, FCN_INT_ACK_KER_REG_A1 );
mb();
falcon_readl ( efab, ®,
WORK_AROUND_BROKEN_PCI_READS_REG_KER_A1 );
#endif
0 };
/* if no addresses supplied, fall back on defaults */
- if (probe_addrs == 0 || probe_addrs[0] == 0)
+ if (probe_addrs == NULL || probe_addrs[0] == 0)
probe_addrs = base;
eth_bmem = 0; /* No shared memory */
for (idx = 0; (eth_nic_base = probe_addrs[idx]) != 0; ++idx) {
} hfa384x_t;
/* The global instance of the hardware (i.e. where we store iobase and membase, in the absence of anywhere better to put them */
-static hfa384x_t hw_global = {
- 0, 0, 0, 0, 0, 0, 0, {0,0,0,0,0,0}
-};
+static hfa384x_t hw_global;
/*
* 802.11 headers in addition to those in hfa384x_tx_frame_t (LLC and SNAP)
// {"NS 83851 PHY",0x2000, 0x5C20, MIX },
{"RTL 8201 10/100Mbps Phyceiver" , 0x0000, 0x8200,rtl8201_read_mode},
{"VIA 6103 10/100Mbps Phyceiver", 0x0101, 0x8f20,vt6103_read_mode},
- {0,0,0,0}
+ {NULL,0,0,NULL}
};
static struct mii_phy {
static const char *media[] = {
"10BaseT-HD ", "10BaseT-FD ", "100baseTx-HD ",
- "100baseTx-FD", "100baseT4", 0
+ "100baseTx-FD", "100baseT4", NULL
};
/* This much match tlan_pci_tbl[]! */
{"Compaq NetFlex-3/E", 0, /* EISA card */
{0, 0, 0, 0, 0, 0},
TLAN_ADAPTER_ACTIVITY_LED, 0x83},
- {0, 0,
+ {NULL, 0,
{0, 0, 0, 0, 0, 0},
0, 0},
};
TULIP_IOTYPE, TULIP_SIZE, COMET },
{ "SG Thomson STE10/100A", { 0x2774104a, 0xffffffff, 0, 0, 0, 0 },
TULIP_IOTYPE, 256, COMET }, /*Ramesh Chander*/
- { 0, { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 },
+ { NULL, { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 },
};
enum tbl_flag {
{ "Xircom tulip work-alike", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
| HAS_PWRDWN | HAS_NWAY },
{ "SGThomson STE10/100A", HAS_MII | MC_HASH_ONLY }, /*Ramesh Chander*/
- { 0, 0 },
+ { NULL, 0 },
};
/* A full-duplex map for media types. */
0x1B03, 0x006D, /* 100baseTx, CSR12 0x1B */
0x1B05, 0x006D, /* 100baseTx-FD CSR12 0x1B */
}},
- {0, 0, 0, 0, {}}};
+ {NULL, 0, 0, 0, {}}};
static const char * block_name[] = {"21140 non-MII", "21140 MII PHY",
"21142 Serial PHY", "21142 MII PHY", "21143 SYM PHY", "21143 reset method"};
whereami("parse_eeprom\n");
- tp->mtable = 0;
+ tp->mtable = NULL;
/* Detect an old-style (SA only) EEPROM layout:
memcmp(ee_data, ee_data+16, 8). */
for (i = 0; i < 8; i ++)
u32 TxPhyAddr, RxPhyAddr;
u32 TxBufPhyAddr, RxBufPhyAddr;
vptr->TxDescArrays = tx_ring;
- if (vptr->TxDescArrays == 0)
+ if (vptr->TxDescArrays == NULL)
printf("Allot Error");
/* Tx Descriptor needs 64 bytes alignment; */
/** Supported command-line options */
static struct option options[] = {
- {"net", 1, 0, 'n'},
- {"settings", 1, 0, 's'},
- {0, 0, 0, 0}
+ {"net", 1, NULL, 'n'},
+ {"settings", 1, NULL, 's'},
+ {NULL, 0, NULL, 0}
};
/**
int c;
if ( n == 0 ) {
- str = '\0';
+ *str = '\0';
return OK;
}
char *fqdn;
/* Leave unchanged if already fully-qualified or no local domain */
- if ( ( ! localdomain ) || ( strchr ( string, '.' ) != 0 ) )
+ if ( ( ! localdomain ) || ( strchr ( string, '.' ) != NULL ) )
return strdup ( string );
/* Append local domain to name */