From: Mao Wenan <maowenan@huawei.com>
To: <kernel-janitors@vger.kernel.org>, <chris.snook@gmail.com>,
<jcliburn@gmail.com>, <dan.carpenter@oracle.com>,
<netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: [PATCH net v3] net: set static variable an initial value in atl2_probe()
Date: Fri, 22 Feb 2019 14:57:23 +0800 [thread overview]
Message-ID: <20190222065723.193392-1-maowenan@huawei.com> (raw)
cards_found is a static variable, but when it enters atl2_probe(),
cards_found is set to zero, the value is not consistent with last probe,
so next behavior is not our expect.
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
v1->v2: change the subject from "net: drop pointless static qualifier in atl2_probe()"
to "net: set static variable an initial value in atl2_probe()";
keep 'static' for variable cards_found.
v2->v3: change patch description, and send patch to netdev mail list.
drivers/net/ethernet/atheros/atlx/atl2.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index bb41becb6609..31ff1e0d1baa 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct atl2_adapter *adapter;
- static int cards_found;
+ static int cards_found = 0;
unsigned long mmio_start;
int mmio_len;
int err;
- cards_found = 0;
-
err = pci_enable_device(pdev);
if (err)
return err;
--
2.20.1
next reply other threads:[~2019-02-22 6:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 6:57 Mao Wenan [this message]
2019-02-23 21:47 ` [PATCH net v3] net: set static variable an initial value in atl2_probe() 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=20190222065723.193392-1-maowenan@huawei.com \
--to=maowenan@huawei.com \
--cc=chris.snook@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=jcliburn@gmail.com \
--cc=kernel-janitors@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