public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test.
@ 2020-03-18 10:24 Gaurav Jain
  2020-03-26 18:40 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Gaurav Jain @ 2020-03-18 10:24 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Pankaj Bansal, Gaurav Jain

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

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
---

Notes:
    v3
    Removed Time Validity Checks in function SetWakeupTime.
    
    v2
    reverted changes related to valid range of years.

 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index 08fb9b0100b6..20f1fa640ecc 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test.
  2020-03-18 10:24 [PATCH v3 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test Gaurav Jain
@ 2020-03-26 18:40 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2020-03-26 18:40 UTC (permalink / raw)
  To: Gaurav Jain; +Cc: edk2-devel-groups-io, Leif Lindholm, Pankaj Bansal

On Tue, 17 Mar 2020 at 11:25, Gaurav Jain <gaurav.jain@nxp.com> wrote:
>
> ASSERT in SetTime_Conf Consistency Test.
> SCT Test expect return as Invalid Parameter.
> So removed ASSERT().
>
> Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>

Thanks Gaurav

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

I will add a note to the commit log describing the other change you
are making in this patch. In the future, please describe the patch
fully - please don't waste people's time by making them guess at the
rationale of your patch.

Pushed as 32bcdfa512bda825d968c69cdeb7d5da89ced62e



> ---
>
> Notes:
>     v3
>     Removed Time Validity Checks in function SetWakeupTime.
>
>     v2
>     reverted changes related to valid range of years.
>
>  EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> index 08fb9b0100b6..20f1fa640ecc 100644
> --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
> @@ -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;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-26 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18 10:24 [PATCH v3 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test Gaurav Jain
2020-03-26 18:40 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox