netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.27-rc5] net/usb/pegasus.c -- avoid hundreds of diagnostics
@ 2008-09-02 18:34 David Brownell
  2008-09-03 13:27 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: David Brownell @ 2008-09-02 18:34 UTC (permalink / raw)
  To: Network development list; +Cc: Jeff Garzik

From: David Brownell <dbrownell@users.sourceforge.net>

Make the "pegasus" driver scream less loudly in the face of
problems as it initializes, avoiding hundreds of messages:

 - ratelimit some key error messages
 - avoid some spurious diagnostics caused by strange codeflow

And fix one instance of goofy indentation.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb)
 	case -ENOENT:
 		break;
 	default:
-		if (netif_msg_drv(pegasus))
+		if (netif_msg_drv(pegasus) && printk_ratelimit())
 			dev_dbg(&pegasus->intf->dev, "%s, status %d\n",
 				__FUNCTION__, urb->status);
 	}
@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
 		set_current_state(TASK_RUNNING);
 		if (ret == -ENODEV)
 			netif_device_detach(pegasus->net);
-		if (netif_msg_drv(pegasus))
+		if (netif_msg_drv(pegasus) && printk_ratelimit())
 			dev_err(&pegasus->intf->dev, "%s, status %d\n",
 					__FUNCTION__, ret);
 		goto out;
@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
 	if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) {
 		if (ret == -ENODEV)
 			netif_device_detach(pegasus->net);
-		if (netif_msg_drv(pegasus))
+		if (netif_msg_drv(pegasus) && printk_ratelimit())
 			dev_err(&pegasus->intf->dev, "%s, status %d\n",
 					__FUNCTION__, ret);
 		goto out;
@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net)
 		pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
 		if (netif_msg_link(pegasus))
 			pr_info("%s: Promiscuous mode enabled.\n", net->name);
-	} else if (net->mc_count ||
-		   (net->flags & IFF_ALLMULTI)) {
+	} else if (net->mc_count || (net->flags & IFF_ALLMULTI)) {
 		pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST;
 		pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
 		if (netif_msg_link(pegasus))
@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net)
 		pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
 	}
 
+	pegasus->ctrl_urb->status = 0;
+
 	pegasus->flags |= ETH_REGS_CHANGE;
 	ctrl_callback(pegasus->ctrl_urb);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 2.6.27-rc5] net/usb/pegasus.c -- avoid hundreds of diagnostics
  2008-09-02 18:34 [patch 2.6.27-rc5] net/usb/pegasus.c -- avoid hundreds of diagnostics David Brownell
@ 2008-09-03 13:27 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-09-03 13:27 UTC (permalink / raw)
  To: David Brownell; +Cc: Network development list

David Brownell wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
> 
> Make the "pegasus" driver scream less loudly in the face of
> problems as it initializes, avoiding hundreds of messages:
> 
>  - ratelimit some key error messages
>  - avoid some spurious diagnostics caused by strange codeflow
> 
> And fix one instance of goofy indentation.
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-03 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-02 18:34 [patch 2.6.27-rc5] net/usb/pegasus.c -- avoid hundreds of diagnostics David Brownell
2008-09-03 13:27 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).