diff options
author | Geert Uytterhoeven <[email protected]> | 2015-11-13 17:04:56 +0100 |
---|---|---|
committer | Geert Uytterhoeven <[email protected]> | 2015-12-17 11:18:29 +0100 |
commit | de01e6cd0b100bac088b1d59a7040ebe2af64f1c (patch) | |
tree | aeaefb1b24c68ad3f41a7769bcc29e08279e39e4 /tools/perf/util/trace-event-scripting.c | |
parent | 95a2703e36530c09a9416321ec21c062f3e91d01 (diff) |
serial: sh-sci: Avoid overflow in sci_baud_calc_hscif()
If bps >= 1048576, the multiplication of the predivider and "bps" will
overflow, and both br and err will contain bogus values.
Skip the current and all higher clock select predividers when overflow
is detected. Simplify the calculations using intermediates while we're
at it.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions