mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
To: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Cc: Martyn Welch <martyn.welch@ge.com>,
	Manohar Vanga <manohar.vanga@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Subject: [PATCHv2 3/9] staging: vme_user: fix NULL comparison style
Date: Tue, 23 Jun 2015 19:03:33 +0300	[thread overview]
Message-ID: <1435075419-28211-4-git-send-email-dmitry.kalinkin@gmail.com> (raw)
In-Reply-To: <1435075419-28211-1-git-send-email-dmitry.kalinkin@gmail.com>

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
---
 drivers/staging/vme/devices/vme_user.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 494655a..2ff15f0 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -527,7 +527,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma)
 	}
 
 	vma_priv = kmalloc(sizeof(struct vme_user_vma_priv), GFP_KERNEL);
-	if (vma_priv == NULL) {
+	if (!vma_priv) {
 		mutex_unlock(&image[minor].mutex);
 		return -ENOMEM;
 	}
@@ -588,7 +588,7 @@ static int vme_user_probe(struct vme_dev *vdev)
 	char *name;
 
 	/* Save pointer to the bridge device */
-	if (vme_user_bridge != NULL) {
+	if (vme_user_bridge) {
 		dev_err(&vdev->dev, "Driver can only be loaded for 1 device\n");
 		err = -EINVAL;
 		goto err_dev;
@@ -636,7 +636,7 @@ static int vme_user_probe(struct vme_dev *vdev)
 		 */
 		image[i].resource = vme_slave_request(vme_user_bridge,
 			VME_A24, VME_SCT);
-		if (image[i].resource == NULL) {
+		if (!image[i].resource) {
 			dev_warn(&vdev->dev,
 				 "Unable to allocate slave resource\n");
 			err = -ENOMEM;
@@ -645,7 +645,7 @@ static int vme_user_probe(struct vme_dev *vdev)
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
 			image[i].size_buf, &image[i].pci_buf);
-		if (image[i].kern_buf == NULL) {
+		if (!image[i].kern_buf) {
 			dev_warn(&vdev->dev,
 				 "Unable to allocate memory for buffer\n");
 			image[i].pci_buf = 0;
@@ -663,7 +663,7 @@ static int vme_user_probe(struct vme_dev *vdev)
 		/* XXX Need to properly request attributes */
 		image[i].resource = vme_master_request(vme_user_bridge,
 			VME_A32, VME_SCT, VME_D32);
-		if (image[i].resource == NULL) {
+		if (!image[i].resource) {
 			dev_warn(&vdev->dev,
 				 "Unable to allocate master resource\n");
 			err = -ENOMEM;
@@ -671,7 +671,7 @@ static int vme_user_probe(struct vme_dev *vdev)
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
-		if (image[i].kern_buf == NULL) {
+		if (!image[i].kern_buf) {
 			err = -ENOMEM;
 			vme_master_free(image[i].resource);
 			goto err_master;
-- 
1.8.3.1


  parent reply	other threads:[~2015-06-23 16:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 12:42 [PATCH 0/9] vme_user checkpatch fixes and read()/write() rework Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 1/9] staging: vme_user: fix code alignment Dmitry Kalinkin
2015-06-23 13:21   ` Frans Klaver
2015-06-23 13:44     ` Dmitry Kalinkin
2015-06-23 13:43       ` Frans Klaver
2015-06-23 12:42 ` [PATCH 2/9] staging: vme_user: fix blank lines Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 3/9] staging: vme_user: fix NULL comparison style Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 4/9] staging: vme_user: fix kmalloc style Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 5/9] staging: vme_user: allow large read()/write() Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors Dmitry Kalinkin
2015-06-23 13:51   ` Dan Carpenter
2015-06-23 14:13     ` Dmitry Kalinkin
2015-06-23 16:03     ` [PATCHv2 0/9] vme_user checkpatch fixes and read()/write() rework Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 1/9] staging: vme_user: fix code alignment Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 2/9] staging: vme_user: fix blank lines Dmitry Kalinkin
2015-06-23 16:03       ` Dmitry Kalinkin [this message]
2015-06-23 16:03       ` [PATCHv2 4/9] staging: vme_user: fix kmalloc style Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 5/9] staging: vme_user: allow large read()/write() Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors Dmitry Kalinkin
2015-06-25 11:27         ` Sudip Mukherjee
2015-06-25 12:05           ` Dmitry Kalinkin
2015-06-25 17:05             ` Dmitry Kalinkin
2015-07-06 12:42             ` Martyn Welch
2015-06-23 16:03       ` [PATCHv2 7/9] staging: vme_user: remove unused variable Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 8/9] staging: vme_user: remove distracting comment Dmitry Kalinkin
2015-06-23 16:03       ` [PATCHv2 9/9] staging: vme_user: remove okcount variable Dmitry Kalinkin
2015-06-26 20:39       ` [PATCHv3 0/9] vme_user checkpatch fixes and read()/write() rework Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 1/9] staging: vme_user: fix code alignment Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 2/9] staging: vme_user: fix blank lines Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 3/9] staging: vme_user: fix NULL comparison style Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 4/9] staging: vme_user: fix kmalloc style Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 5/9] staging: vme_user: allow large read()/write() Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 6/9] staging: vme_user: switch to returning -EFAULT on __copy_*_user errors Dmitry Kalinkin
2015-07-06 12:51           ` Martyn Welch
2015-07-06 13:10             ` Dmitry Kalinkin
2015-07-06 13:51               ` Martyn Welch
2015-06-26 20:39         ` [PATCHv3 7/9] staging: vme_user: remove unused variable Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 8/9] staging: vme_user: remove distracting comment Dmitry Kalinkin
2015-06-26 20:39         ` [PATCHv3 9/9] staging: vme_user: remove okcount variable Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 7/9] staging: vme_user: remove unused variable Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 8/9] staging: vme_user: remove distracting comment Dmitry Kalinkin
2015-06-23 12:42 ` [PATCH 9/9] staging: vme_user: remove okcount variable Dmitry Kalinkin

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=1435075419-28211-4-git-send-email-dmitry.kalinkin@gmail.com \
    --to=dmitry.kalinkin@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn.welch@ge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®