Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1704754 > unrolled thread

[PATCH 0/3] ATM-iphase: Adjustments for some function implementations

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-08-06 08:30 +0200
Last post2017-08-06 08:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] ATM-iphase: Adjustments for some function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-06 08:30 +0200
    [PATCH 3/3] ATM-iphase: Adjust four checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-06 08:40 +0200

#1704754 — [PATCH 0/3] ATM-iphase: Adjustments for some function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-06 08:30 +0200
Subject[PATCH 0/3] ATM-iphase: Adjustments for some function implementations
Message-ID<ubnex-76u-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 08:18:28 +0200

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Adjust 11 function calls together with a variable assignment
  Delete five error messages for a failed memory allocation
  Adjust four checks for null pointers

 drivers/atm/iphase.c | 95 +++++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 46 deletions(-)

-- 
2.13.4

[toc] | [next] | [standalone]


#1704755 — [PATCH 3/3] ATM-iphase: Adjust four checks for null pointers

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-06 08:40 +0200
Subject[PATCH 3/3] ATM-iphase: Adjust four checks for null pointers
Message-ID<ubnod-79u-1@gated-at.bofh.it>
In reply to#1704754
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web