diff mbox series

[net-next,v2] lib8390: Use netif_msg_init to initialize msg_enable bits

Message ID 20200930210016.11607-1-W_Armin@gmx.de
State New
Headers show
Series [net-next,v2] lib8390: Use netif_msg_init to initialize msg_enable bits | expand

Commit Message

Armin Wolf Sept. 30, 2020, 9 p.m. UTC
Use netif_msg_init() to process param settings
and use only the proper initialized value of
ei_local->msg_enable for later processing;

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
v2 changes:
- confused ei_local-> msg_enable with default_msg_level
---
 drivers/net/ethernet/8390/lib8390.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--
2.20.1

Comments

David Miller Oct. 2, 2020, 2:09 a.m. UTC | #1
From: Armin Wolf <W_Armin@gmx.de>
Date: Wed, 30 Sep 2020 23:00:16 +0200

> Use netif_msg_init() to process param settings
> and use only the proper initialized value of
> ei_local->msg_enable for later processing;
> 
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> ---
> v2 changes:
> - confused ei_local-> msg_enable with default_msg_level

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index deba94d2c909..e84021282edf 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -113,8 +113,10 @@  static void do_set_multicast_list(struct net_device *dev);
 static void __NS8390_init(struct net_device *dev, int startp);

 static unsigned version_printed;
-static u32 msg_enable;
-module_param(msg_enable, uint, 0444);
+static int msg_enable;
+static const int default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_RX_ERR |
+				     NETIF_MSG_TX_ERR);
+module_param(msg_enable, int, 0444);
 MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");

 /*
@@ -974,14 +976,14 @@  static void ethdev_setup(struct net_device *dev)
 {
 	struct ei_device *ei_local = netdev_priv(dev);

-	if ((msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0))
-		pr_info("%s", version);
-
 	ether_setup(dev);

 	spin_lock_init(&ei_local->page_lock);

-	ei_local->msg_enable = msg_enable;
+	ei_local->msg_enable = netif_msg_init(msg_enable, default_msg_level);
+
+	if (netif_msg_drv(ei_local) && (version_printed++ == 0))
+		pr_info("%s", version);
 }

 /**