Skip to content

Commit

Permalink
staging/fwserial: Simplify max payload calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Jan 30, 2013
1 parent 5d110d9 commit d835618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/fwserial/fwserial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit d835618

Please sign in to comment.