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 1/4] atm: idt77252: Adjust four function calls together with a variable assignment
Date: Sat, 5 Aug 2017 14:26:45 +0200	[thread overview]
Message-ID: <c03d54ed-7c1d-351b-3e84-30cc4af38c5f@users.sourceforge.net> (raw)
In-Reply-To: <df946de6-8112-2a23-ec98-ac6418ca8486@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 4 Aug 2017 22:20:08 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/idt77252.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b7a168c46692..6a051f5909d0 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -1070,7 +1070,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
 
 		cell = skb->data;
 		for (i = (stat & SAR_RSQE_CELLCNT); i; i--) {
-			if ((sb = dev_alloc_skb(64)) == NULL) {
+			sb = dev_alloc_skb(64);
+			if (!sb) {
 				printk("%s: Can't allocate buffers for aal0.\n",
 				       card->name);
 				atomic_add(i, &vcc->stats->rx_drop);
@@ -1304,7 +1305,8 @@ idt77252_rx_raw(struct idt77252_dev *card)
 			goto drop;
 		}
 	
-		if ((sb = dev_alloc_skb(64)) == NULL) {
+		sb = dev_alloc_skb(64);
+		if (!sb) {
 			printk("%s: Can't allocate buffers for AAL0.\n",
 			       card->name);
 			atomic_inc(&vcc->stats->rx_err);
@@ -3600,13 +3602,14 @@ static int idt77252_init_one(struct pci_dev *pcidev,
 	struct atm_dev *dev;
 	int i, err;
 
-
-	if ((err = pci_enable_device(pcidev))) {
+	err = pci_enable_device(pcidev);
+	if (err) {
 		printk("idt77252: can't enable PCI device at %s\n", pci_name(pcidev));
 		return err;
 	}
 
-	if ((err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)))) {
+	err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32));
+	if (err) {
 		printk("idt77252: can't enable DMA for PCI device at %s\n", pci_name(pcidev));
 		return err;
 	}
-- 
2.13.4

  reply	other threads:[~2017-08-05 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-05 12:24 [PATCH 0/4] atm: idt77252: Adjustments for some function implementations SF Markus Elfring
2017-08-05 12:26 ` SF Markus Elfring [this message]
2017-08-05 12:28 ` [PATCH 2/4] atm: idt77252: Delete an error message for a failed memory allocation in seven functions SF Markus Elfring
2017-08-06 19:06   ` kbuild test robot
2017-08-05 12:30 ` [PATCH 3/4] atm: idt77252: Improve seven size determinations SF Markus Elfring
2017-08-05 12:32 ` [PATCH 4/4] atm: idt77252: Adjust ten checks for null pointers SF Markus Elfring

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=c03d54ed-7c1d-351b-3e84-30cc4af38c5f@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).