Commit ddf1169f authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: use "if (!foo)" test style

Replace "if (foo == NULL)" statements with "if (!foo)" to be consistent
across the driver.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b99f8036
...@@ -2034,7 +2034,7 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo) ...@@ -2034,7 +2034,7 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
*/ */
for (;;) { for (;;) {
rxcp = be_rx_compl_get(rxo); rxcp = be_rx_compl_get(rxo);
if (rxcp == NULL) { if (!rxcp) {
if (lancer_chip(adapter)) if (lancer_chip(adapter))
break; break;
...@@ -2941,7 +2941,7 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable) ...@@ -2941,7 +2941,7 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable)
cmd.size = sizeof(struct be_cmd_req_acpi_wol_magic_config); cmd.size = sizeof(struct be_cmd_req_acpi_wol_magic_config);
cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma, cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
GFP_KERNEL); GFP_KERNEL);
if (cmd.va == NULL) if (!cmd.va)
return -ENOMEM; return -ENOMEM;
if (enable) { if (enable) {
...@@ -4133,7 +4133,7 @@ static int lancer_fw_download(struct be_adapter *adapter, ...@@ -4133,7 +4133,7 @@ static int lancer_fw_download(struct be_adapter *adapter,
static int be_get_ufi_type(struct be_adapter *adapter, static int be_get_ufi_type(struct be_adapter *adapter,
struct flash_file_hdr_g3 *fhdr) struct flash_file_hdr_g3 *fhdr)
{ {
if (fhdr == NULL) if (!fhdr)
goto be_get_ufi_exit; goto be_get_ufi_exit;
if (skyhawk_chip(adapter) && fhdr->build[0] == '4') if (skyhawk_chip(adapter) && fhdr->build[0] == '4')
...@@ -4475,12 +4475,12 @@ static int be_map_pci_bars(struct be_adapter *adapter) ...@@ -4475,12 +4475,12 @@ static int be_map_pci_bars(struct be_adapter *adapter)
if (BEx_chip(adapter) && be_physfn(adapter)) { if (BEx_chip(adapter) && be_physfn(adapter)) {
adapter->csr = pci_iomap(adapter->pdev, 2, 0); adapter->csr = pci_iomap(adapter->pdev, 2, 0);
if (adapter->csr == NULL) if (!adapter->csr)
return -ENOMEM; return -ENOMEM;
} }
addr = pci_iomap(adapter->pdev, db_bar(adapter), 0); addr = pci_iomap(adapter->pdev, db_bar(adapter), 0);
if (addr == NULL) if (!addr)
goto pci_map_err; goto pci_map_err;
adapter->db = addr; adapter->db = addr;
...@@ -4543,7 +4543,7 @@ static int be_ctrl_init(struct be_adapter *adapter) ...@@ -4543,7 +4543,7 @@ static int be_ctrl_init(struct be_adapter *adapter)
rx_filter->va = dma_zalloc_coherent(&adapter->pdev->dev, rx_filter->va = dma_zalloc_coherent(&adapter->pdev->dev,
rx_filter->size, &rx_filter->dma, rx_filter->size, &rx_filter->dma,
GFP_KERNEL); GFP_KERNEL);
if (rx_filter->va == NULL) { if (!rx_filter->va) {
status = -ENOMEM; status = -ENOMEM;
goto free_mbox; goto free_mbox;
} }
...@@ -4592,7 +4592,7 @@ static int be_stats_init(struct be_adapter *adapter) ...@@ -4592,7 +4592,7 @@ static int be_stats_init(struct be_adapter *adapter)
cmd->va = dma_zalloc_coherent(&adapter->pdev->dev, cmd->size, &cmd->dma, cmd->va = dma_zalloc_coherent(&adapter->pdev->dev, cmd->size, &cmd->dma,
GFP_KERNEL); GFP_KERNEL);
if (cmd->va == NULL) if (!cmd->va)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
} }
...@@ -4814,7 +4814,7 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id) ...@@ -4814,7 +4814,7 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
pci_set_master(pdev); pci_set_master(pdev);
netdev = alloc_etherdev_mqs(sizeof(*adapter), MAX_TX_QS, MAX_RX_QS); netdev = alloc_etherdev_mqs(sizeof(*adapter), MAX_TX_QS, MAX_RX_QS);
if (netdev == NULL) { if (!netdev) {
status = -ENOMEM; status = -ENOMEM;
goto rel_reg; goto rel_reg;
} }
......
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