diff mbox

e1000e, igbvf: fix default message level

Message ID 20120310084921.GA4647@elgon.mountain
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter March 10, 2012, 8:49 a.m. UTC
The intent here was to enable both NETIF_MSG_DRV and NETIF_MSG_PROBE
messages, but in the original code only the NETIF_MSG_DRV bit was set.

NETIF_MSG_DRV and NETIF_MSG_PROBE are bits 0 and 1, they are not
supposed to be used to do a shift.  I think the confusion is because
the msg_enable can also be controlled through ethtool which passes a bit
number that is used to do a bit shift.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Kirsher, Jeffrey T March 10, 2012, 9:02 a.m. UTC | #1
On Sat, 2012-03-10 at 11:49 +0300, Dan Carpenter wrote:
> The intent here was to enable both NETIF_MSG_DRV and NETIF_MSG_PROBE
> messages, but in the original code only the NETIF_MSG_DRV bit was set.
> 
> NETIF_MSG_DRV and NETIF_MSG_PROBE are bits 0 and 1, they are not
> supposed to be used to do a shift.  I think the confusion is because
> the msg_enable can also be controlled through ethtool which passes a
> bit
> number that is used to do a bit shift.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> 

Thanks Dan!  I will add the patch to my queue.
Ben Hutchings March 10, 2012, 11:06 p.m. UTC | #2
On Sat, 2012-03-10 at 11:49 +0300, Dan Carpenter wrote:
> The intent here was to enable both NETIF_MSG_DRV and NETIF_MSG_PROBE
> messages, but in the original code only the NETIF_MSG_DRV bit was set.
> 
> NETIF_MSG_DRV and NETIF_MSG_PROBE are bits 0 and 1, they are not
> supposed to be used to do a shift.  I think the confusion is because
> the msg_enable can also be controlled through ethtool which passes a bit
> number that is used to do a bit shift.
[...]

No, the ethtool interface also uses a mask.

However netif_msg_init() is commonly used to initialise the msg_enable
mask based on a module parameter that's a bit number.

Ben.
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 217c143..e50c2ec 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2649,7 +2649,7 @@  static int __devinit igbvf_probe(struct pci_dev *pdev,
 	adapter->flags = ei->flags;
 	adapter->hw.back = adapter;
 	adapter->hw.mac.type = ei->mac;
-	adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
+	adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE;
 
 	/* PCI config space info */
 
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 7152eb1..0e2de0b 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6172,7 +6172,7 @@  static int __devinit e1000_probe(struct pci_dev *pdev,
 	adapter->hw.adapter = adapter;
 	adapter->hw.mac.type = ei->mac;
 	adapter->max_hw_frame_size = ei->max_hw_frame_size;
-	adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
+	adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE;
 
 	mmio_start = pci_resource_start(pdev, 0);
 	mmio_len = pci_resource_len(pdev, 0);