All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Li <lipeng321@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <xie.he.0141@gmail.com>,
	<ms@dev.tdt.de>, <willemb@google.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<huangguangbin2@huawei.com>
Subject: [PATCH net-next 2/6] net: hostess_sv11: move out assignment in if condition
Date: Thu, 17 Jun 2021 22:53:31 +0800	[thread overview]
Message-ID: <1623941615-26966-3-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1623941615-26966-1-git-send-email-lipeng321@huawei.com>

Should not use assignment in if condition.

Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/wan/hostess_sv11.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index a18c09d..8dce8b1 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -340,7 +340,8 @@ static struct z8530_dev *sv11_unit;
 
 int init_module(void)
 {
-	if ((sv11_unit = sv11_init(io, irq)) == NULL)
+	sv11_unit = sv11_init(io, irq);
+	if (!sv11_unit)
 		return -ENODEV;
 	return 0;
 }
-- 
2.8.1


  parent reply	other threads:[~2021-06-17 14:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 14:53 [PATCH net-next 0/6] net: hostess_sv11: clean up some code style issues Peng Li
2021-06-17 14:53 ` [PATCH net-next 1/6] net: hostess_sv11: fix the code style issue about "foo* bar" Peng Li
2021-06-17 14:53 ` Peng Li [this message]
2021-06-17 14:53 ` [PATCH net-next 3/6] net: hostess_sv11: remove trailing whitespace Peng Li
2021-06-17 14:53 ` [PATCH net-next 4/6] net: hostess_sv11: fix the code style issue about switch and case Peng Li
2021-06-17 14:53 ` [PATCH net-next 5/6] net: hostess_sv11: fix the comments style issue Peng Li
2021-06-17 16:29   ` Andrew Lunn
2021-06-18  0:45     ` lipeng (Y)
2021-06-17 14:53 ` [PATCH net-next 6/6] net: hostess_sv11: fix the alignment issue Peng Li

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=1623941615-26966-3-git-send-email-lipeng321@huawei.com \
    --to=lipeng321@huawei.com \
    --cc=davem@davemloft.net \
    --cc=huangguangbin2@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=xie.he.0141@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.