List of changes:
- Use integer multiplication instead of long multiplication.
- Remove multiple if-statements and predict new if-statements.
- Rename local variable name, "ticks" into "retval" to avoid shadowing
the system "ticks" global variable.
MFC after: 1 week
Sponsored by: NVIDIA Networking