Changeset d91d50f in rtems


Ignore:
Timestamp:
Jul 2, 2013, 1:14:51 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
818edbd
Parents:
c97d3dd
git-author:
Sebastian Huber <sebastian.huber@…> (07/02/13 13:14:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/05/13 14:01:03)
Message:

bsp/mpc55xx: Avoid integer overflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mpc55xxevb/startup/get-system-clock.c

    rc97d3dd rd91d50f  
    6464      uint32_t erfd = esyncr2.B.ERFD;
    6565
    66       system_clock = (reference_clock * (emfd + 16))
    67         / ((erfd + 1) * (eprediv + 1));
     66      system_clock = ((reference_clock / (eprediv + 1)) * (emfd + 16))
     67        / (erfd + 1);
    6868    } else {
    6969      system_clock = reference_clock;
Note: See TracChangeset for help on using the changeset viewer.