2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

staging/fwserial: Simplify max payload calculation

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peter Hurley 2013-01-28 20:57:46 -05:00 committed by Greg Kroah-Hartman
parent 5d110d9296
commit d83561894d

View File

@ -377,8 +377,8 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
*/
static inline int link_speed_to_max_payload(unsigned speed)
{
speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800);
return 1 << (speed + 9);
/* Max async payload is 4096 - see IEEE 1394-2008 tables 6-4, 16-18 */
return min(512 << speed, 4096);
}
#endif /* _FIREWIRE_FWSERIAL_H */