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,
	Julia Lawall <julia.lawall@lip6.fr>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 5/5] ATM-nicstar: Refactor a dev_alloc_skb() call in dequeue_rx()
Date: Sat, 10 Sep 2016 09:21:29 +0200	[thread overview]
Message-ID: <b6465bc0-f0ff-b3b6-8872-79b84f7300f8@users.sourceforge.net> (raw)
In-Reply-To: <fe480e1f-285a-bb98-3550-b4fa354f8174@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Sep 2016 08:56:03 +0200

The script "checkpatch.pl" can point out that assignments should usually
not be performed within condition checks.
Thus move an assignment for a local variable to a separate statement
in this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/nicstar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 04f5781..c7296b5 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -2023,7 +2023,8 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
 
 		cell = skb->data;
 		for (i = ns_rsqe_cellcount(rsqe); i; i--) {
-			if ((sb = dev_alloc_skb(NS_SMSKBSIZE)) == NULL) {
+			sb = dev_alloc_skb(NS_SMSKBSIZE);
+			if (!sb) {
 				printk
 				    ("nicstar%d: Can't allocate buffers for aal0.\n",
 				     card->index);
-- 
2.10.0

  parent reply	other threads:[~2016-09-10  7:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10  7:15 [PATCH 0/5] ATM-nicstar: Fine-tuning for three function implementations SF Markus Elfring
2016-09-10  7:17 ` [PATCH 1/5] ATM-nicstar: Use kmalloc_array() in get_scq() SF Markus Elfring
2016-09-10  7:18 ` [PATCH 2/5] ATM-nicstar: Improve another size determination " SF Markus Elfring
2016-09-10  7:19 ` [PATCH 3/5] ATM-nicstar: Improve another size determination in ns_init_card() SF Markus Elfring
2016-09-10  7:20 ` [PATCH 4/5] ATM-nicstar: Refactor a kmalloc() call " SF Markus Elfring
2016-09-10  7:21 ` SF Markus Elfring [this message]
2016-09-11  4:46 ` [PATCH 0/5] ATM-nicstar: Fine-tuning for three function implementations David Miller

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=b6465bc0-f0ff-b3b6-8872-79b84f7300f8@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=3chas3@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.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).