diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-09-19 00:20:48 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-10-09 17:00:18 +0200 |
commit | 4ec4a67aa100268b4ac5ae32b54843d975969969 (patch) | |
tree | 0cb2413784e788939edd625c2b163c7f410f2c61 /drivers/firewire/net.c | |
parent | b810e4ae111cb8b4c0ccbbe7ff4ea0a23c671e4f (diff) | |
download | linux-3.10-4ec4a67aa100268b4ac5ae32b54843d975969969.tar.gz linux-3.10-4ec4a67aa100268b4ac5ae32b54843d975969969.tar.bz2 linux-3.10-4ec4a67aa100268b4ac5ae32b54843d975969969.zip |
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/net.c')
-rw-r--r-- | drivers/firewire/net.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 03a7a85d042..d1fad1fb17e 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -502,11 +502,7 @@ static struct fwnet_peer *fwnet_peer_find_by_node_id(struct fwnet_device *dev, static unsigned fwnet_max_payload(unsigned max_rec, unsigned speed) { max_rec = min(max_rec, speed + 8); - max_rec = min(max_rec, 0xbU); /* <= 4096 */ - if (max_rec < 8) { - fw_notify("max_rec %x out of range\n", max_rec); - max_rec = 8; - } + max_rec = clamp(max_rec, 8U, 11U); /* 512...4096 */ return (1 << (max_rec + 1)) - RFC2374_FRAG_HDR_SIZE; } |