From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.5526.1580376111067171363 for ; Thu, 30 Jan 2020 01:21:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=dGOlLcPG; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wm1-f65.google.com with SMTP id t23so2948813wmi.1 for ; Thu, 30 Jan 2020 01:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BaFkROtCYs3tJ9SmAxnU1zsL/7SdY9M5aj3+Q9leUH4=; b=dGOlLcPG/TU8FbMidgYfq6FecRUwlh81WTCqH8Bw/bGgrlAGaaUCDxRLAWM6kWI0M7 O/m9o3EzuIoKDcPT3CU5srFAj+uOQ527i1UJFQXKJa7kuAEdT8+PNdWxRuhCQ5g+6mge ezrcQD+DD7nSfsffvv/5e6KYNN0wFM6PGYQ1r5HmPFCH7hKG4Y6nqhi97WEyHjZY+bWY BHDEDlSjrdmAiBV7BaNYeeN5gjH+KA1dLFcLKhVeuppZwwIDOeZKAEH5HUeT2OrejVM1 ozzZFNYxv6RSmfTZz7AE6MP/D+IUbyW7NIVexpfktUDmV2RiI6wJ03xqYK6D/TiiIvMN 4QYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BaFkROtCYs3tJ9SmAxnU1zsL/7SdY9M5aj3+Q9leUH4=; b=h3juH4u/PyFZdpnc3fAWxXR0BqsJK5M0zqCRrRP6G3pL872QHDYxLklfJcQXMuZ1IN XUhV8Wr1cFxq+zanbexIYg07PiWYvup6afHFq6S78omSB4VxjqmziRgduw2dgywQQJKT r0DwPEtGPSqlWQTEUe1Cu1BV6AtAndZE35F00Ivg2Oq/2DA+Mm44tAIojTQpgp7SpCAi Dq9iKDEK+w7V6SGk8LaIJBIbRQBCP9elk0BXk0FY3fg8kI9S1JN70K/amFkwsXXaQrvf q+fPdEnyb0ABjrmEly5cms6y39n7BU6bm9Lm1/W0N5HFVQO9bkKbc3C1+5rBj4o3UWHM 01iQ== X-Gm-Message-State: APjAAAWL9g9pAnXstKuNNVlGRMowDdSyk1v5zDz6dz66Kgpu53w/Ffe3 tfvtutCKQslIAuUv+Dum+UvDRiLCT5J1QeZyNQKHvQ== X-Google-Smtp-Source: APXvYqxUsa71qMv/hDkYbHm5LvftgP7dgiqDsF/Dci3LrCR8qD7WoNPH3lws6oB+3WDYNd0xszfpt1zA6yQ7o+Dm1PI= X-Received: by 2002:a05:600c:248:: with SMTP id 8mr4344359wmj.1.1580376109575; Thu, 30 Jan 2020 01:21:49 -0800 (PST) MIME-Version: 1.0 References: <20200130102826.20759-1-gaurav.jain@nxp.com> In-Reply-To: <20200130102826.20759-1-gaurav.jain@nxp.com> From: "Ard Biesheuvel" Date: Thu, 30 Jan 2020 10:21:38 +0100 Message-ID: Subject: Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test. To: Gaurav Jain Cc: "devel@edk2.groups.io" , Leif Lindholm , Pankaj Bansal Content-Type: text/plain; charset="UTF-8" On Thu, 30 Jan 2020 at 06:08, Gaurav Jain wrote: > > ASSERT in SetTime_Conf and SetWakeupTime_Conf Consistency Test. > SCT Test expect return as Invalid Parameter. > So removed ASSERT(). > This is not all this patch does. > Signed-off-by: Gaurav Jain > --- > EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c > index 08fb9b0100b6..9bfb7756f0cb 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)) { > @@ -105,14 +101,15 @@ IsTimeValid( > ) > { > // Check the input parameters are within the range specified by UEFI > - if (Time->Year < 1900 || > - Time->Year > 9999 || > + if (Time->Year < 1998 || > + Time->Year > 2099 || That original range is based on the UEFI spec. On what basis are you making this change? If your RTC hardware cannot represent the original values, this is not the place to fix that. > Time->Month < 1 || > Time->Month > 12 || > !IsDayValid (Time) || > Time->Hour > 23 || > Time->Minute > 59 || > Time->Second > 59 || > + Time->Nanosecond > 999999999 || > !IsValidTimeZone (Time->TimeZone) || > !IsValidDaylight (Time->Daylight)) { > return FALSE; > @@ -254,6 +251,9 @@ SetWakeupTime ( > OUT EFI_TIME *Time > ) > { > + if (Time == NULL || !IsTimeValid (Time)) { > + return EFI_INVALID_PARAMETER; > + } > return LibSetWakeupTime (Enabled, Time); > } > > -- > 2.17.1 >