Commit 8273f0a3 authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller

net: pxa168_eth: Adjust four checks for null pointers

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written …

Thus fix the affected source code places.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 91acebed
...@@ -556,11 +556,11 @@ static int init_hash_table(struct pxa168_eth_private *pep) ...@@ -556,11 +556,11 @@ static int init_hash_table(struct pxa168_eth_private *pep)
* function.Driver can dynamically switch to them if the 1/2kB hash * function.Driver can dynamically switch to them if the 1/2kB hash
* table is full. * table is full.
*/ */
if (pep->htpr == NULL) { if (!pep->htpr) {
pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent, pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent,
HASH_ADDR_TABLE_SIZE, HASH_ADDR_TABLE_SIZE,
&pep->htpr_dma, GFP_KERNEL); &pep->htpr_dma, GFP_KERNEL);
if (pep->htpr == NULL) if (!pep->htpr)
return -ENOMEM; return -ENOMEM;
} else { } else {
memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE); memset(pep->htpr, 0, HASH_ADDR_TABLE_SIZE);
...@@ -1356,7 +1356,7 @@ static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum, ...@@ -1356,7 +1356,7 @@ static int pxa168_smi_write(struct mii_bus *bus, int phy_addr, int regnum,
static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr,
int cmd) int cmd)
{ {
if (dev->phydev != NULL) if (dev->phydev)
return phy_mii_ioctl(dev->phydev, ifr, cmd); return phy_mii_ioctl(dev->phydev, ifr, cmd);
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1501,7 +1501,7 @@ static int pxa168_eth_probe(struct platform_device *pdev) ...@@ -1501,7 +1501,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
pep->timeout.data = (unsigned long)pep; pep->timeout.data = (unsigned long)pep;
pep->smi_bus = mdiobus_alloc(); pep->smi_bus = mdiobus_alloc();
if (pep->smi_bus == NULL) { if (!pep->smi_bus) {
err = -ENOMEM; err = -ENOMEM;
goto err_netdev; goto err_netdev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment