linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] s390: virtio: Adjust a null pointer check in two functions
Date: Tue, 16 May 2017 17:53:55 +0200	[thread overview]
Message-ID: <078ad841-544f-b989-4fdc-5f33acc220e7@users.sourceforge.net> (raw)
In-Reply-To: <d02fd34c-da59-0c33-d859-e49ecb4eb1c5@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 17:14:26 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written …

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/s390/virtio/virtio_ccw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index bfb845d7faa7..27ab0f0b59cd 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -513,7 +513,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
 	}
 	size = PAGE_ALIGN(vring_size(info->num, KVM_VIRTIO_CCW_RING_ALIGN));
 	info->queue = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
-	if (info->queue == NULL) {
+	if (!info->queue) {
 		dev_warn(&vcdev->cdev->dev, "no queue\n");
 		err = -ENOMEM;
 		goto out_err;
@@ -1388,7 +1388,7 @@ static void __init no_auto_parse(void)
 				 &from_ssid, &from);
 		if (rc)
 			continue;
-		if (parm != NULL) {
+		if (parm) {
 			rc = parse_busid(parm, &to_cssid,
 					 &to_ssid, &to);
 			if ((from_ssid > to_ssid) ||
-- 
2.13.0

      parent reply	other threads:[~2017-05-16 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 15:50 [PATCH 0/3] S390-virtio: Adjustments for three function implementations SF Markus Elfring
2017-05-16 15:51 ` [PATCH 1/3] s390: virtio: Delete error messages for failed memory allocations in two functions SF Markus Elfring
2017-05-16 15:52 ` [PATCH 2/3] s390: virtio: Improve a size determination in virtio_ccw_setup_vq() SF Markus Elfring
2017-05-16 15:53 ` SF Markus Elfring [this message]

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=078ad841-544f-b989-4fdc-5f33acc220e7@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cornelia.huck@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=virtualization@lists.linux-foundation.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).