|
|
Subscribe / Log in / New account

USB ATM: robustify poll throttling

From:  Duncan Sands <duncan.sands@math.u-psud.fr>
To:  Greg KH <greg@kroah.com>
Subject:  [PATCH] USB ATM: robustify poll throttling
Date:  Thu, 23 Jun 2005 09:23:10 +0200
Cc:  usbatm@lists.infradead.org, linux-usb-devel@lists.sourceforge.net

No functional change, but less likely to break in the future.

Signed-off-by: Duncan Sands <baldrick@free.fr>

Index: Linux/drivers/usb/atm/speedtch.c
===================================================================
--- Linux.orig/drivers/usb/atm/speedtch.c	2005-06-23 09:02:45.508925765 +0200
+++ Linux/drivers/usb/atm/speedtch.c	2005-06-23 09:05:42.564761044 +0200
@@ -430,13 +430,11 @@
 	ret = speedtch_read_status(instance);
 	if (ret < 0) {
 		atm_warn(usbatm, "error %d fetching device status\n", ret);
-		if (instance->poll_delay < MAX_POLL_DELAY)
-			instance->poll_delay *= 2;
+		instance->poll_delay = min(2 * instance->poll_delay, MAX_POLL_DELAY);
 		return;
 	}
 
-	if (instance->poll_delay > MIN_POLL_DELAY)
-		instance->poll_delay /= 2;
+	instance->poll_delay = max(instance->poll_delay / 2, MIN_POLL_DELAY);
 
 	atm_dbg(usbatm, "%s: line state %02x\n", __func__, buf[OFFSET_7]);
 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op...
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel



Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds