You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
NULL noise in drivers/net
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
+1
-1
@@ -1361,7 +1361,7 @@ static int boomerang_rx(struct net_device *dev)
|
||||
/* Check if the packet is long enough to just accept without
|
||||
copying to a properly sized skbuff. */
|
||||
if (pkt_len < rx_copybreak
|
||||
&& (skb = dev_alloc_skb(pkt_len + 4)) != 0) {
|
||||
&& (skb = dev_alloc_skb(pkt_len + 4)) != NULL) {
|
||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||
memcpy(skb_put(skb, pkt_len),
|
||||
|
||||
+3
-5
@@ -277,8 +277,6 @@ static int lance_rx (struct net_device *dev)
|
||||
volatile struct lance_init_block *ib = lp->init_block;
|
||||
volatile struct lance_rx_desc *rd;
|
||||
unsigned char bits;
|
||||
int len = 0; /* XXX shut up gcc warnings */
|
||||
struct sk_buff *skb = 0; /* XXX shut up gcc warnings */
|
||||
#ifdef TEST_HITS
|
||||
int i;
|
||||
#endif
|
||||
@@ -318,10 +316,10 @@ static int lance_rx (struct net_device *dev)
|
||||
if (bits & LE_R1_FRA) dev->stats.rx_frame_errors++;
|
||||
if (bits & LE_R1_EOP) dev->stats.rx_errors++;
|
||||
} else {
|
||||
len = (rd->mblength & 0xfff) - 4;
|
||||
skb = dev_alloc_skb (len+2);
|
||||
int len = (rd->mblength & 0xfff) - 4;
|
||||
struct sk_buff *skb = dev_alloc_skb (len+2);
|
||||
|
||||
if (skb == 0) {
|
||||
if (!skb) {
|
||||
printk ("%s: Memory squeeze, deferring packet.\n",
|
||||
dev->name);
|
||||
dev->stats.rx_dropped++;
|
||||
|
||||
+4
-6
@@ -269,8 +269,6 @@ static int lance_rx (struct net_device *dev)
|
||||
volatile struct lance_regs *ll = lp->ll;
|
||||
volatile struct lance_rx_desc *rd;
|
||||
unsigned char bits;
|
||||
int len = 0; /* XXX shut up gcc warnings */
|
||||
struct sk_buff *skb = 0; /* XXX shut up gcc warnings */
|
||||
|
||||
#ifdef TEST_HITS
|
||||
int i;
|
||||
@@ -306,10 +304,10 @@ static int lance_rx (struct net_device *dev)
|
||||
if (bits & LE_R1_FRA) dev->stats.rx_frame_errors++;
|
||||
if (bits & LE_R1_EOP) dev->stats.rx_errors++;
|
||||
} else {
|
||||
len = (rd->mblength & 0xfff) - 4;
|
||||
skb = dev_alloc_skb (len+2);
|
||||
int len = (rd->mblength & 0xfff) - 4;
|
||||
struct sk_buff *skb = dev_alloc_skb (len+2);
|
||||
|
||||
if (skb == 0) {
|
||||
if (!skb) {
|
||||
printk(KERN_WARNING "%s: Memory squeeze, "
|
||||
"deferring packet.\n", dev->name);
|
||||
dev->stats.rx_dropped++;
|
||||
@@ -477,7 +475,7 @@ static irqreturn_t lance_interrupt (int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
struct net_device *last_dev = 0;
|
||||
struct net_device *last_dev;
|
||||
|
||||
static int lance_open (struct net_device *dev)
|
||||
{
|
||||
|
||||
+2
-2
@@ -2757,7 +2757,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
|
||||
}
|
||||
|
||||
#ifdef BCM_VLAN
|
||||
if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && (bp->vlgrp != 0)) {
|
||||
if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && bp->vlgrp) {
|
||||
vlan_hwaccel_receive_skb(skb, bp->vlgrp,
|
||||
rx_hdr->l2_fhdr_vlan_tag);
|
||||
}
|
||||
@@ -5660,7 +5660,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM;
|
||||
}
|
||||
|
||||
if (bp->vlgrp != 0 && vlan_tx_tag_present(skb)) {
|
||||
if (bp->vlgrp && vlan_tx_tag_present(skb)) {
|
||||
vlan_tag_flags |=
|
||||
(TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16));
|
||||
}
|
||||
|
||||
@@ -5085,7 +5085,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
|
||||
|
||||
/* give us access to cassini registers */
|
||||
cp->regs = pci_iomap(pdev, 0, casreg_len);
|
||||
if (cp->regs == 0UL) {
|
||||
if (!cp->regs) {
|
||||
dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
|
||||
goto err_out_free_res;
|
||||
}
|
||||
|
||||
@@ -1788,7 +1788,7 @@ speedo_rx(struct net_device *dev)
|
||||
/* Check if the packet is long enough to just accept without
|
||||
copying to a properly sized skbuff. */
|
||||
if (pkt_len < rx_copybreak
|
||||
&& (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
|
||||
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
|
||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||
pci_dma_sync_single_for_cpu(sp->pdev, sp->rx_ring_dma[entry],
|
||||
|
||||
@@ -701,7 +701,7 @@ static void sixpack_close(struct tty_struct *tty)
|
||||
sp = tty->disc_data;
|
||||
tty->disc_data = NULL;
|
||||
write_unlock(&disc_data_lock);
|
||||
if (sp == 0)
|
||||
if (!sp)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
||||
@@ -821,7 +821,7 @@ static void mkiss_close(struct tty_struct *tty)
|
||||
tty->disc_data = NULL;
|
||||
write_unlock(&disc_data_lock);
|
||||
|
||||
if (ax == 0)
|
||||
if (!ax)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1153,7 +1153,7 @@ static void hp100_init_pdls(struct net_device *dev)
|
||||
printk("hp100: %s: init pdls\n", dev->name);
|
||||
#endif
|
||||
|
||||
if (0 == lp->page_vaddr_algn)
|
||||
if (!lp->page_vaddr_algn)
|
||||
printk("hp100: %s: Warning: lp->page_vaddr_algn not initialised!\n", dev->name);
|
||||
else {
|
||||
/* pageptr shall point into the DMA accessible memory region */
|
||||
|
||||
@@ -289,7 +289,7 @@ struct net_device * __init mac89x0_probe(int unit)
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out1;
|
||||
return 0;
|
||||
return NULL;
|
||||
out1:
|
||||
nubus_writew(0, dev->base_addr + ADD_PORT);
|
||||
out:
|
||||
|
||||
+5
-5
@@ -409,7 +409,7 @@ static inline void mace_clean_rings(struct mace_data *mp)
|
||||
|
||||
/* free some skb's */
|
||||
for (i = 0; i < N_RX_RING; ++i) {
|
||||
if (mp->rx_bufs[i] != 0) {
|
||||
if (mp->rx_bufs[i] != NULL) {
|
||||
dev_kfree_skb(mp->rx_bufs[i]);
|
||||
mp->rx_bufs[i] = NULL;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ static int mace_open(struct net_device *dev)
|
||||
cp = mp->rx_cmds;
|
||||
for (i = 0; i < N_RX_RING - 1; ++i) {
|
||||
skb = dev_alloc_skb(RX_BUFLEN + 2);
|
||||
if (skb == 0) {
|
||||
if (!skb) {
|
||||
data = dummy_buf;
|
||||
} else {
|
||||
skb_reserve(skb, 2); /* so IP header lands on 4-byte bdry */
|
||||
@@ -903,7 +903,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
|
||||
out_le16(&cp->command, DBDMA_STOP);
|
||||
/* got a packet, have a look at it */
|
||||
skb = mp->rx_bufs[i];
|
||||
if (skb == 0) {
|
||||
if (!skb) {
|
||||
++dev->stats.rx_dropped;
|
||||
} else if (nb > 8) {
|
||||
data = skb->data;
|
||||
@@ -953,9 +953,9 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
|
||||
break;
|
||||
cp = mp->rx_cmds + i;
|
||||
skb = mp->rx_bufs[i];
|
||||
if (skb == 0) {
|
||||
if (!skb) {
|
||||
skb = dev_alloc_skb(RX_BUFLEN + 2);
|
||||
if (skb != 0) {
|
||||
if (skb) {
|
||||
skb_reserve(skb, 2);
|
||||
mp->rx_bufs[i] = skb;
|
||||
}
|
||||
|
||||
@@ -354,8 +354,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
goto err_out_free_netdev;
|
||||
}
|
||||
|
||||
if (((mem_ptr0 == 0UL) && (mem_len == NETXEN_PCI_128MB_SIZE)) ||
|
||||
(mem_ptr1 == 0UL) || (mem_ptr2 == 0UL)) {
|
||||
if ((!mem_ptr0 && mem_len == NETXEN_PCI_128MB_SIZE) ||
|
||||
!mem_ptr1 || !mem_ptr2) {
|
||||
DPRINTK(ERR,
|
||||
"Cannot remap adapter memory aborting.:"
|
||||
"0 -> %p, 1 -> %p, 2 -> %p\n",
|
||||
@@ -1337,7 +1337,7 @@ static struct pci_driver netxen_driver = {
|
||||
|
||||
static int __init netxen_init_module(void)
|
||||
{
|
||||
if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0)
|
||||
if ((netxen_workq = create_singlethread_workqueue("netxen")) == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
return pci_register_driver(&netxen_driver);
|
||||
|
||||
@@ -1746,7 +1746,7 @@ static void queue_llc_rx(struct s_smc *smc, SMbuf *mb)
|
||||
DB_GEN("queue_llc_rx: mb = %x",(void *)mb,0,4) ;
|
||||
smc->os.hwm.queued_rx_frames++ ;
|
||||
mb->sm_next = (SMbuf *)NULL ;
|
||||
if (smc->os.hwm.llc_rx_pipe == 0) {
|
||||
if (smc->os.hwm.llc_rx_pipe == NULL) {
|
||||
smc->os.hwm.llc_rx_pipe = mb ;
|
||||
}
|
||||
else {
|
||||
@@ -1786,7 +1786,7 @@ static void queue_txd_mb(struct s_smc *smc, SMbuf *mb)
|
||||
DB_GEN("_rx: queue_txd_mb = %x",(void *)mb,0,4) ;
|
||||
smc->os.hwm.queued_txd_mb++ ;
|
||||
mb->sm_next = (SMbuf *)NULL ;
|
||||
if (smc->os.hwm.txd_tx_pipe == 0) {
|
||||
if (smc->os.hwm.txd_tx_pipe == NULL) {
|
||||
smc->os.hwm.txd_tx_pipe = mb ;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -712,7 +712,7 @@ void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs)
|
||||
smc->mib.priv.fddiPRIVECF_Reply_Rx++ ;
|
||||
DB_SMT("SMT: received ECF reply from %s\n",
|
||||
addr_to_string(&sm->smt_source),0) ;
|
||||
if (sm_to_para(smc,sm,SMT_P_ECHODATA) == 0) {
|
||||
if (sm_to_para(smc,sm,SMT_P_ECHODATA) == NULL) {
|
||||
DB_SMT("SMT: ECHODATA missing\n",0,0) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
@@ -3056,7 +3056,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
|
||||
netif_carrier_off(dev);
|
||||
|
||||
gp->regs = ioremap(gemreg_base, gemreg_len);
|
||||
if (gp->regs == 0UL) {
|
||||
if (!gp->regs) {
|
||||
printk(KERN_ERR PFX "Cannot map device registers, "
|
||||
"aborting.\n");
|
||||
err = -EIO;
|
||||
|
||||
@@ -3060,7 +3060,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
|
||||
goto err_out_clear_quattro;
|
||||
}
|
||||
|
||||
if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == 0) {
|
||||
if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) {
|
||||
printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n");
|
||||
goto err_out_free_res;
|
||||
}
|
||||
|
||||
+1
-1
@@ -12675,7 +12675,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
|
||||
tg3reg_len = pci_resource_len(pdev, 2);
|
||||
|
||||
tp->aperegs = ioremap_nocache(tg3reg_base, tg3reg_len);
|
||||
if (tp->aperegs == 0UL) {
|
||||
if (!tp->aperegs) {
|
||||
printk(KERN_ERR PFX "Cannot map APE registers, "
|
||||
"aborting.\n");
|
||||
err = -ENOMEM;
|
||||
|
||||
@@ -2310,7 +2310,7 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
|
||||
&& (tp->acb_head->subcmd
|
||||
== RW_TRC_STATUS_BLOCK))
|
||||
{
|
||||
if(tp->ptr_bcn_type != 0)
|
||||
if(tp->ptr_bcn_type)
|
||||
{
|
||||
*(tp->ptr_bcn_type)
|
||||
= (__u32)((SBlock *)tp->misc_command_data)->BCN_Type;
|
||||
@@ -2980,7 +2980,7 @@ static int smctr_load_firmware(struct net_device *dev)
|
||||
return (UCODE_PRESENT);
|
||||
|
||||
/* Verify the firmware exists and is there in the right amount. */
|
||||
if((tp->ptr_ucode == 0L)
|
||||
if (!tp->ptr_ucode
|
||||
|| (*(tp->ptr_ucode + UCODE_VERSION_OFFSET) < UCODE_VERSION))
|
||||
{
|
||||
return (UCODE_NOT_PRESENT);
|
||||
|
||||
@@ -491,13 +491,13 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
|
||||
int pos;
|
||||
int timeout = 500000;
|
||||
|
||||
if(xc.data == 0x0){
|
||||
if (!xc.data) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
data = kmalloc(xc.len, GFP_KERNEL);
|
||||
if(data == 0x0){
|
||||
if (!data) {
|
||||
printk(KERN_WARNING "%s: Failed to allocate memory for copy\n", dev->name);
|
||||
ret = -ENOMEM;
|
||||
break;
|
||||
@@ -1643,7 +1643,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
|
||||
* just allocate an skb buff and continue.
|
||||
*/
|
||||
|
||||
if(skb == 0x0){
|
||||
if (!skb) {
|
||||
nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2);
|
||||
if (nsb) {
|
||||
sc->lmc_rxq[i] = nsb;
|
||||
|
||||
@@ -1219,10 +1219,6 @@ lmc_t1_watchdog (lmc_softc_t * const sc)
|
||||
static void
|
||||
lmc_set_protocol (lmc_softc_t * const sc, lmc_ctl_t * ctl)
|
||||
{
|
||||
if (ctl == 0)
|
||||
{
|
||||
sc->ictl.keepalive_onoff = LMC_CTL_ON;
|
||||
|
||||
return;
|
||||
}
|
||||
if (!ctl)
|
||||
sc->ictl.keepalive_onoff = LMC_CTL_ON;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user