All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laura Garcia Liebana <nevola@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH 5/7] staging: netlogic: Fix comparison to NULL
Date: Mon, 15 Feb 2016 23:39:14 +0100	[thread overview]
Message-ID: <ed3fe66bf2dfec6a6364deb07047a9955cfd3cfc.1455575263.git.nevola@gmail.com> (raw)
In-Reply-To: <cover.1455575263.git.nevola@gmail.com>

Avoid the use of comparison to NULL, use !<variable> instead. Checkpatch
detected these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
 drivers/staging/netlogic/xlr_net.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 4b72f03..c5df08e 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -146,7 +146,7 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, int code,
 		addr = addr - MAC_SKB_BACK_PTR_SIZE;
 		skb = (struct sk_buff *)*(unsigned long *)addr;
 		skb->dev = adapter->netdev[port];
-		if (skb->dev == NULL)
+		if (!skb->dev)
 			return;
 		ndev = skb->dev;
 		priv = netdev_priv(ndev);
@@ -1037,7 +1037,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 		priv->nd = (struct xlr_net_data *)pdev->dev.platform_data;
 		res = platform_get_resource(pdev, IORESOURCE_MEM, port);
 
-		if (res == NULL) {
+		if (!res) {
 			pr_err("No memory resource for MAC %d\n",
 			       priv->port_id);
 			err = -ENODEV;
@@ -1052,7 +1052,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 		adapter->netdev[port] = ndev;
 
 		res = platform_get_resource(pdev, IORESOURCE_IRQ, port);
-		if (res == NULL) {
+		if (!res) {
 			pr_err("No irq resource for MAC %d\n", priv->port_id);
 			err = -ENODEV;
 			goto err_gmac;
-- 
2.7.0



  parent reply	other threads:[~2016-02-15 22:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 22:36 [PATCH 0/7] staging: netlogic: Fix several checkpatch issues Laura Garcia Liebana
2016-02-15 22:36 ` [PATCH 1/7] staging: netlogic: Fix several parenthesis alignments Laura Garcia Liebana
2016-02-15 22:37 ` [PATCH 2/7] staging: netlogic: Remove blank spaces after a cast Laura Garcia Liebana
2016-02-16 14:20   ` [Outreachy kernel] " Julia Lawall
2016-02-15 22:38 ` [PATCH 3/7] staging: netlogic: Fix multiple assignments Laura Garcia Liebana
2016-02-15 22:38 ` [PATCH 4/7] staging: netlogic: Fix CamelCase for constants Laura Garcia Liebana
2016-02-15 22:39 ` Laura Garcia Liebana [this message]
2016-02-16 14:18   ` [Outreachy kernel] [PATCH 5/7] staging: netlogic: Fix comparison to NULL Julia Lawall
2016-02-15 22:39 ` [PATCH 6/7] staging: netlogic: Insert spaces around operator Laura Garcia Liebana
2016-02-15 22:40 ` [PATCH 7/7] staging: netlogic: Fix indent for conditional statement Laura Garcia Liebana

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=ed3fe66bf2dfec6a6364deb07047a9955cfd3cfc.1455575263.git.nevola@gmail.com \
    --to=nevola@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.