All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings
Date: Wed, 23 Dec 2015 13:53:58 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.10.1512231352410.4367@hadrien> (raw)

Kernel code typically uses == NULL.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

CC: Gangfeng Huang <gangfeng.huang@ni.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

---

Alternatively, consider using !adapter.

 igb_cdev.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/net/ethernet/intel/igb/igb_cdev.c
+++ b/drivers/net/ethernet/intel/igb/igb_cdev.c
@@ -92,7 +92,7 @@ static int igb_bind(struct file *file, v

 	adapter = (struct igb_adapter *)file->private_data;

-	if (NULL == adapter)
+	if (adapter == NULL)
 		return -ENOENT;

 	mmap_size = pci_resource_len(adapter->pdev, 0);
@@ -119,7 +119,7 @@ static long igb_mapring(struct file *fil
 		return -EINVAL;

 	adapter = file->private_data;
-	if (NULL == adapter) {
+	if (adapter == NULL) {
 		dev_err(&adapter->pdev->dev, "map to unbound device!\n");
 		return -ENOENT;
 	}
@@ -182,7 +182,7 @@ static long igb_mapbuf(struct file *file
 		return -EINVAL;

 	adapter = file->private_data;
-	if (NULL == adapter) {
+	if (adapter == NULL) {
 		dev_err(&adapter->pdev->dev, "map to unbound device!\n");
 		return -ENOENT;
 	}
@@ -246,7 +246,7 @@ static long igb_unmapring(struct file *f
 		return -EINVAL;

 	adapter = file->private_data;
-	if (NULL == adapter) {
+	if (adapter == NULL) {
 		dev_err(&adapter->pdev->dev, "map to unbound device!\n");
 		return -ENOENT;
 	}
@@ -310,7 +310,7 @@ static long igb_unmapbuf(struct file *fi
 		return -EFAULT;

 	adapter = file->private_data;
-	if (NULL == adapter) {
+	if (adapter == NULL) {
 		dev_err(&adapter->pdev->dev, "map to unbound device!\n");
 		return -ENOENT;
 	}
@@ -398,7 +398,7 @@ static int igb_close_file(struct inode *
 {
 	struct igb_adapter *adapter = file->private_data;

-	if (NULL == adapter)
+	if (adapter == NULL)
 		return 0;

 	mutex_lock(&adapter->cdev_mutex);
@@ -434,7 +434,7 @@ static int igb_mmap(struct file *file, s
 	dma_addr_t pgoff = vma->vm_pgoff;
 	dma_addr_t physaddr;

-	if (NULL == adapter)
+	if (adapter == NULL)
 		return -ENODEV;

 	if (pgoff == 0)

             reply	other threads:[~2015-12-23 12:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 12:53 Julia Lawall [this message]
2015-12-23 12:58 ` [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings Julia Lawall
2016-01-07  3:12   ` Brown, Aaron F
2016-01-07  6:22     ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2015-12-14 15:00 Julia Lawall
2015-12-18  2:58 ` Brown, Aaron F

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=alpine.DEB.2.10.1512231352410.4367@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=intel-wired-lan@osuosl.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 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.