netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
	Chas Williams <3chas3@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] ATM-iphase: Adjust four checks for null pointers
Date: Sun, 6 Aug 2017 08:30:12 +0200	[thread overview]
Message-ID: <693faecc-81ea-6d85-788c-b42924a2afb1@users.sourceforge.net> (raw)
In-Reply-To: <c30df8dd-a6e9-23c1-842b-afa8696e10d4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 5 Aug 2017 22:30:04 +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/atm/iphase.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index ad4c1b41ba98..19782fed572a 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -101,7 +101,7 @@ static void ia_init_rtn_q (IARTN_Q *que)
 static void ia_enque_head_rtn_q (IARTN_Q *que, IARTN_Q * data) 
 {
    data->next = NULL;
-   if (que->next == NULL) 
+	if (!que->next)
       que->next = que->tail = data;
    else {
       data->next = que->next;
@@ -116,7 +116,7 @@ static int ia_enque_rtn_q (IARTN_Q *que, struct desc_tbl_t data) {
       return -ENOMEM;
    entry->data = data;
    entry->next = NULL;
-   if (que->next == NULL) 
+	if (!que->next)
       que->next = que->tail = entry;
    else {
       que->tail->next = entry;
@@ -127,7 +127,7 @@ static int ia_enque_rtn_q (IARTN_Q *que, struct desc_tbl_t data) {
 
 static IARTN_Q * ia_deque_rtn_q (IARTN_Q *que) {
    IARTN_Q *tmpdata;
-   if (que->next == NULL)
+	if (!que->next)
       return NULL;
    tmpdata = que->next;
    if ( que->next == que->tail)  
@@ -1321,7 +1321,7 @@ static void rx_dle_intr(struct atm_dev *dev)
               goto INCR_DLE;
           }
           ia_vcc = INPH_IA_VCC(vcc);
-          if (ia_vcc == NULL)
+		if (!ia_vcc)
           {
              atomic_inc(&vcc->stats->rx_err);
              atm_return(vcc, skb->truesize);
-- 
2.13.4

      parent reply	other threads:[~2017-08-06  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-06  6:23 [PATCH 0/3] ATM-iphase: Adjustments for some function implementations SF Markus Elfring
2017-08-06  6:26 ` [PATCH 1/3] ATM-iphase: Adjust 11 function calls together with a variable assignment SF Markus Elfring
2017-08-06  6:28 ` [PATCH 2/3] ATM-iphase: Delete five error messages for a failed memory allocation SF Markus Elfring
2017-08-06  6:30 ` 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=693faecc-81ea-6d85-788c-b42924a2afb1@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=3chas3@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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).