EmbeddedPkg/RealTimeClockRuntimeDxe: Drop ASSERTs on function arguments

ASSERT in SetTime_Conf Consistency Test.
SCT Test expect return as Invalid Parameter.
So removed ASSERT().

While at it, check that the NanoSecond field is within the range given
by the UEFI specification.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Gaurav Jain 2020-03-18 15:54:19 +05:30 committed by mergify[bot]
parent 5f7c91f0d7
commit 32bcdfa512
1 changed files with 1 additions and 4 deletions

View File

@ -85,10 +85,6 @@ IsDayValid (
IN EFI_TIME *Time
)
{
ASSERT (Time->Day >= 1);
ASSERT (Time->Day <= mDayOfMonth[Time->Month - 1]);
ASSERT (Time->Month != 2 || IsLeapYear (Time) || Time->Day <= 28);
if (Time->Day < 1 ||
Time->Day > mDayOfMonth[Time->Month - 1] ||
(Time->Month == 2 && !IsLeapYear (Time) && Time->Day > 28)) {
@ -113,6 +109,7 @@ IsTimeValid(
Time->Hour > 23 ||
Time->Minute > 59 ||
Time->Second > 59 ||
Time->Nanosecond > 999999999 ||
!IsValidTimeZone (Time->TimeZone) ||
!IsValidDaylight (Time->Daylight)) {
return FALSE;