Hi,
> + if ((BaseFreq == 0x0) || (ClockMultiplier == 0x0) || (ClockDivide == 0x0))
> {
> + DEBUG ((
> + DEBUG_ERROR,
> + "LoongArch Stable Timer is not available in the CPU, hence this
> library cannot be used.\n"
> + ));
> + ASSERT (FALSE);
> + CpuDeadLoop ();
> + }
> +
> + StableTimerFreq = ((ClockMultiplier * BaseFreq) / ClockDivide);
> +
> + if (StableTimerFreq == 0x0) {
> + ASSERT (FALSE);
> + }
If you don't want to log a message (as in the case above) you can
simplify this to "ASSERT(StableTimerFreq != 0);" Additional benefit
is that it'll give a more helpful log message.
> + //
> + // Ticks
> + // Time = --------- x 1,000,000,000
> + // Frequency
> + //
> + Status = SafeUint64Mult (
> + DivU64x64Remainder (Ticks, Frequency, &Remainder),
> + 1000000000u,
> + &NanoSeconds
> + );
Not checking Status here?
take care,
Gerd
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116745): https://edk2.groups.io/g/devel/message/116745
Mute This Topic: https://groups.io/mt/104859876/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-