linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-s390@vger.kernel.org,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>,
	"Jan Höppner" <hoeppner@linux.vnet.ibm.com>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
	"Stefan Haberland" <sth@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] s390/dasd: Adjust six checks for null pointers
Date: Wed, 10 May 2017 20:03:08 +0200	[thread overview]
Message-ID: <1395faca-9953-5873-0892-3d2eedbef2b6@users.sourceforge.net> (raw)
In-Reply-To: <4af00744-1c8a-6b33-22c8-d26d569f6c5f@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 May 2017 19:29:17 +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/block/dasd_eckd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index e78601d97a67..d02f3bbbd552 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1080,7 +1080,7 @@ static int dasd_eckd_read_conf(struct dasd_device *device)
 					"error %d", rc);
 			return rc;
 		}
-		if (conf_data == NULL) {
+		if (!conf_data) {
 			DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
 					"No configuration data "
 					"retrieved");
@@ -2049,7 +2049,7 @@ static int dasd_eckd_end_analysis(struct dasd_block *block)
 				 "Track 0 has no records following the VTOC\n");
 	}
 
-	if (count_area != NULL && count_area->kl == 0) {
+	if (count_area && count_area->kl == 0) {
 		/* we found notthing violating our disk layout */
 		if (dasd_check_blocksize(count_area->dl) == 0)
 			block->bp_block = count_area->dl;
@@ -2649,10 +2649,10 @@ static int dasd_eckd_format_process_data(struct dasd_device *base,
 	old_start = fdata->start_unit;
 	old_stop = fdata->stop_unit;
 
-	if (!tpm && fmt_buffer != NULL) {
+	if (!tpm && fmt_buffer) {
 		/* Command Mode / Format Check */
 		format_step = 1;
-	} else if (tpm && fmt_buffer != NULL) {
+	} else if (tpm && fmt_buffer) {
 		/* Transport Mode / Format Check */
 		format_step = DASD_CQR_MAX_CCW / rpt;
 	} else {
@@ -4681,7 +4681,7 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
 	int len, sl, sct;
 
 	page = (char *) get_zeroed_page(GFP_ATOMIC);
-	if (page == NULL) {
+	if (!page) {
 		DBF_DEV_EVENT(DBF_WARNING, device, "%s",
 			      "No memory to dump sense data\n");
 		return;
@@ -4785,7 +4785,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
 	u8 *sense, *rcq;
 
 	page = (char *) get_zeroed_page(GFP_ATOMIC);
-	if (page == NULL) {
+	if (!page) {
 		DBF_DEV_EVENT(DBF_WARNING, device, " %s",
 			    "No memory to dump sense data");
 		return;
-- 
2.12.3

  parent reply	other threads:[~2017-05-10 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 18:00 [PATCH 0/3] S390-DASD: Fine-tuning for some function implementations SF Markus Elfring
2017-05-10 18:01 ` [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() SF Markus Elfring
2017-05-10 19:28   ` Dan Carpenter
2017-05-10 22:30   ` kbuild test robot
2017-05-10 18:02 ` [PATCH 2/3] s390/dasd: Fix typos in two comment lines SF Markus Elfring
2017-05-10 18:03 ` SF Markus Elfring [this message]
2017-12-14 10:34 ` [PATCH 0/3] S390-DASD: Fine-tuning for some function implementations SF Markus Elfring
2017-12-14 11:07   ` Heiko Carstens

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=1395faca-9953-5873-0892-3d2eedbef2b6@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hoeppner@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sth@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).