diff options
author | Duncan Sands <duncan.sands@math.u-psud.fr> | 2005-06-23 11:23:10 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-07-12 22:52:55 +0400 |
commit | cd5c08fb7b0d960b7cd48bc977feee7b3bd8b046 (patch) | |
tree | ad58c82f7a16104c08f965f8ce2640ea8f3545bb /drivers | |
parent | 322a95bc8eba889d2f9d7222936d682c9aad8294 (diff) | |
download | linux-cd5c08fb7b0d960b7cd48bc977feee7b3bd8b046.tar.xz |
[PATCH] USB ATM: robustify poll throttling
No functional change, but less likely to break in the future.
Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/atm/speedtch.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 992db1c16838..03a0e99a4267 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -430,13 +430,11 @@ static void speedtch_check_status(struct speedtch_instance_data *instance) 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]); |