netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 10/14] be2net: use "if (!foo)" test style
Date: Thu, 17 Jul 2014 16:20:28 +0530	[thread overview]
Message-ID: <1405594232-30818-11-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1405594232-30818-1-git-send-email-sathya.perla@emulex.com>

From: Kalesh AP <kalesh.purayil@emulex.com>

Replace "if (foo == NULL)" statements with "if (!foo)" to be consistent
across the driver.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 1abca8b..b354b28 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2034,7 +2034,7 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
 	 */
 	for (;;) {
 		rxcp = be_rx_compl_get(rxo);
-		if (rxcp == NULL) {
+		if (!rxcp) {
 			if (lancer_chip(adapter))
 				break;
 
@@ -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.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
 				     GFP_KERNEL);
-	if (cmd.va == NULL)
+	if (!cmd.va)
 		return -ENOMEM;
 
 	if (enable) {
@@ -4133,7 +4133,7 @@ lancer_fw_exit:
 static int be_get_ufi_type(struct be_adapter *adapter,
 			   struct flash_file_hdr_g3 *fhdr)
 {
-	if (fhdr == NULL)
+	if (!fhdr)
 		goto be_get_ufi_exit;
 
 	if (skyhawk_chip(adapter) && fhdr->build[0] == '4')
@@ -4475,12 +4475,12 @@ static int be_map_pci_bars(struct be_adapter *adapter)
 
 	if (BEx_chip(adapter) && be_physfn(adapter)) {
 		adapter->csr = pci_iomap(adapter->pdev, 2, 0);
-		if (adapter->csr == NULL)
+		if (!adapter->csr)
 			return -ENOMEM;
 	}
 
 	addr = pci_iomap(adapter->pdev, db_bar(adapter), 0);
-	if (addr == NULL)
+	if (!addr)
 		goto pci_map_err;
 	adapter->db = addr;
 
@@ -4543,7 +4543,7 @@ static int be_ctrl_init(struct be_adapter *adapter)
 	rx_filter->va = dma_zalloc_coherent(&adapter->pdev->dev,
 					    rx_filter->size, &rx_filter->dma,
 					    GFP_KERNEL);
-	if (rx_filter->va == NULL) {
+	if (!rx_filter->va) {
 		status = -ENOMEM;
 		goto free_mbox;
 	}
@@ -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,
 				      GFP_KERNEL);
-	if (cmd->va == NULL)
+	if (!cmd->va)
 		return -ENOMEM;
 	return 0;
 }
@@ -4814,7 +4814,7 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
 	pci_set_master(pdev);
 
 	netdev = alloc_etherdev_mqs(sizeof(*adapter), MAX_TX_QS, MAX_RX_QS);
-	if (netdev == NULL) {
+	if (!netdev) {
 		status = -ENOMEM;
 		goto rel_reg;
 	}
-- 
1.7.1

  parent reply	other threads:[~2014-07-17 10:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 10:50 [PATCH net-next 00/14] be2net: patch set Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 01/14] be2net: use -ENETDOWN error status when interface is down Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 02/14] be2net: fix error status for FW-download Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 03/14] be2net: return -ETIMEDOUT when a FW-cmd times out Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 04/14] be2net: return -ENOMEM for memory allocation failures Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 05/14] be2net: fix return status of some ethtool methods Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 06/14] be2net: fix return status of some ndo methods Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 07/14] be2net: update UE bit description strings Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 08/14] be2net: reduce arguments passed to FW-cmd routines Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 09/14] be2net: remove unused structures in be_cmds.h Sathya Perla
2014-07-17 10:50 ` Sathya Perla [this message]
2014-07-17 10:50 ` [PATCH net-next 11/14] be2net: use be_max_vfs() macro to access max-vfs Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 12/14] be2net: avoid SRIOV config for BE2 chip Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 13/14] be2net: use adapter->flags to track SRIOV state Sathya Perla
2014-07-17 10:50 ` [PATCH net-next 14/14] be2net: update driver version to 10.4 Sathya Perla
2014-07-17 23:38 ` [PATCH net-next 00/14] be2net: patch set David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405594232-30818-11-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).