diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-01-28 20:57:46 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-29 23:26:16 -0500 |
commit | d83561894db22ee9c40fdd85d49eb5ee573125cc (patch) | |
tree | 5f6748402476e30e28a2b3797958b78df2a69006 | |
parent | 5d110d92961317c1f289396473be3c26d01f171c (diff) |
staging/fwserial: Simplify max payload calculation
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/fwserial/fwserial.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/fwserial/fwserial.h b/drivers/staging/fwserial/fwserial.h index e157318cb7da..953ece69c10d 100644 --- a/drivers/staging/fwserial/fwserial.h +++ b/drivers/staging/fwserial/fwserial.h | |||
@@ -377,8 +377,8 @@ static inline void fwtty_bind_console(struct fwtty_port *port, | |||
377 | */ | 377 | */ |
378 | static inline int link_speed_to_max_payload(unsigned speed) | 378 | static inline int link_speed_to_max_payload(unsigned speed) |
379 | { | 379 | { |
380 | speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800); | 380 | /* Max async payload is 4096 - see IEEE 1394-2008 tables 6-4, 16-18 */ |
381 | return 1 << (speed + 9); | 381 | return min(512 << speed, 4096); |
382 | } | 382 | } |
383 | 383 | ||
384 | #endif /* _FIREWIRE_FWSERIAL_H */ | 384 | #endif /* _FIREWIRE_FWSERIAL_H */ |