Skip to content

Commit

Permalink
netxen: ratelimit error prints
Browse files Browse the repository at this point in the history
If for some reason, read from card memory fails the console
get flooded with failure prints. This patch confines print
under printk_ratelimit().

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Feb 18, 2009
1 parent d8313ce commit 39754f4
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions drivers/net/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,8 +1579,9 @@ netxen_nic_pci_mem_write_128M(struct netxen_adapter *adapter,
}

if (j >= MAX_CTL_CHECK) {
printk("%s: %s Fail to write through agent\n",
__func__, netxen_nic_driver_name);
if (printk_ratelimit())
dev_err(&adapter->pdev->dev,
"failed to write through agent\n");
ret = -1;
break;
}
Expand Down Expand Up @@ -1637,8 +1638,9 @@ netxen_nic_pci_mem_read_128M(struct netxen_adapter *adapter,
}

if (j >= MAX_CTL_CHECK) {
printk(KERN_ERR "%s: %s Fail to read through agent\n",
__func__, netxen_nic_driver_name);
if (printk_ratelimit())
dev_err(&adapter->pdev->dev,
"failed to read through agent\n");
break;
}

Expand Down Expand Up @@ -1773,8 +1775,9 @@ netxen_nic_pci_mem_write_2M(struct netxen_adapter *adapter,
}

if (j >= MAX_CTL_CHECK) {
printk(KERN_ERR "%s: Fail to write through agent\n",
netxen_nic_driver_name);
if (printk_ratelimit())
dev_err(&adapter->pdev->dev,
"failed to write through agent\n");
ret = -1;
break;
}
Expand Down Expand Up @@ -1843,8 +1846,9 @@ netxen_nic_pci_mem_read_2M(struct netxen_adapter *adapter,
}

if (j >= MAX_CTL_CHECK) {
printk(KERN_ERR "%s: Fail to read through agent\n",
netxen_nic_driver_name);
if (printk_ratelimit())
dev_err(&adapter->pdev->dev,
"failed to read through agent\n");
break;
}

Expand Down

0 comments on commit 39754f4

Please sign in to comment.