diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-09-19 02:20:48 +0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-10-09 19:00:18 +0400 |
commit | 4ec4a67aa100268b4ac5ae32b54843d975969969 (patch) | |
tree | 0cb2413784e788939edd625c2b163c7f410f2c61 /drivers/firewire/core-transaction.c | |
parent | b810e4ae111cb8b4c0ccbbe7ff4ea0a23c671e4f (diff) | |
download | linux-4ec4a67aa100268b4ac5ae32b54843d975969969.tar.xz |
firewire: use clamp and min3 macros
Use kernel.h's convenience macros. Also omit a printk that should never
happen and won't matter much if it ever happened.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r-- | drivers/firewire/core-transaction.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 334b82a3542c..855ab3f5936f 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -1046,8 +1046,8 @@ static void update_split_timeout(struct fw_card *card) cycles = card->split_timeout_hi * 8000 + (card->split_timeout_lo >> 19); - cycles = max(cycles, 800u); /* minimum as per the spec */ - cycles = min(cycles, 3u * 8000u); /* maximum OHCI timeout */ + /* minimum per IEEE 1394, maximum which doesn't overflow OHCI */ + cycles = clamp(cycles, 800u, 3u * 8000u); card->split_timeout_cycles = cycles; card->split_timeout_jiffies = DIV_ROUND_UP(cycles * HZ, 8000); |