Commit b0b815a3 authored by Guofeng Yue's avatar Guofeng Yue Committed by David S. Miller
Browse files

net: amd: Unified the comparison between pointers and NULL to the same writing



Using the unified way to compare pointers and NULL, which cleans the static
warning.

eg:
	if (skb == NULL) --> if (!skb)
	if (skb != NULL) --> if (skb)

Signed-off-by: default avatarGuofeng Yue <yueguofeng@hisilicon.com>
Signed-off-by: default avatarHaoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 454e7b13
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ static int a2065_init_one(struct zorro_dev *z,
	}

	dev = alloc_etherdev(sizeof(struct lance_private));
	if (dev == NULL) {
	if (!dev) {
		release_mem_region(base_addr, sizeof(struct lance_regs));
		release_mem_region(mem_start, A2065_RAM_SIZE);
		return -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ static int amd8111e_free_skbs(struct net_device *dev)
	/* Freeing previously allocated receive buffers */
	for (i = 0; i < NUM_RX_BUFFERS; i++) {
		rx_skbuff = lp->rx_skbuff[i];
		if (rx_skbuff != NULL) {
		if (rx_skbuff) {
			dma_unmap_single(&lp->pci_dev->dev,
					 lp->rx_dma_addr[i],
					 lp->rx_buff_len - 2, DMA_FROM_DEVICE);
@@ -1084,7 +1084,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id)
	unsigned int intr0, intren0;
	unsigned int handled = 1;

	if (unlikely(dev == NULL))
	if (unlikely(!dev))
		return IRQ_NONE;

	spin_lock(&lp->lock);
+2 −2
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static int ariadne_rx(struct net_device *dev)
			struct sk_buff *skb;

			skb = netdev_alloc_skb(dev, pkt_len + 2);
			if (skb == NULL) {
			if (!skb) {
				for (i = 0; i < RX_RING_SIZE; i++)
					if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN)
						break;
@@ -731,7 +731,7 @@ static int ariadne_init_one(struct zorro_dev *z,
	}

	dev = alloc_etherdev(sizeof(struct ariadne_private));
	if (dev == NULL) {
	if (!dev) {
		release_mem_region(base_addr, sizeof(struct Am79C960));
		release_mem_region(mem_start, ARIADNE_RAM_SIZE);
		return -ENOMEM;
+2 −2
Original line number Diff line number Diff line
@@ -854,7 +854,7 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id )
	int csr0, boguscnt = 10;
	int handled = 0;

	if (dev == NULL) {
	if (!dev) {
		DPRINTK( 1, ( "lance_interrupt(): interrupt for unknown device.\n" ));
		return IRQ_NONE;
	}
@@ -995,7 +995,7 @@ static int lance_rx( struct net_device *dev )
			}
			else {
				skb = netdev_alloc_skb(dev, pkt_len + 2);
				if (skb == NULL) {
				if (!skb) {
					for( i = 0; i < RX_RING_SIZE; i++ )
						if (MEM->rx_head[(entry+i) & RX_RING_MOD_MASK].flag &
							RMD1_OWN_CHIP)
+3 −3
Original line number Diff line number Diff line
@@ -786,7 +786,7 @@ static int au1000_rx(struct net_device *dev)
			frmlen = (status & RX_FRAME_LEN_MASK);
			frmlen -= 4; /* Remove FCS */
			skb = netdev_alloc_skb(dev, frmlen + 2);
			if (skb == NULL) {
			if (!skb) {
				dev->stats.rx_dropped++;
				continue;
			}
@@ -1199,7 +1199,7 @@ static int au1000_probe(struct platform_device *pdev)
	}

	aup->mii_bus = mdiobus_alloc();
	if (aup->mii_bus == NULL) {
	if (!aup->mii_bus) {
		dev_err(&pdev->dev, "failed to allocate mdiobus structure\n");
		err = -ENOMEM;
		goto err_mdiobus_alloc;
@@ -1284,7 +1284,7 @@ static int au1000_probe(struct platform_device *pdev)
	return 0;

err_out:
	if (aup->mii_bus != NULL)
	if (aup->mii_bus)
		mdiobus_unregister(aup->mii_bus);

	/* here we should have a valid dev plus aup-> register addresses
Loading