]> git.proxmox.com Git - mirror_edk2.git/commitdiff
HalRuntimeServicesExampleLib/Rtc.c : Added missing comments
authorRonald Cron <ronald.cron@arm.com>
Mon, 1 Sep 2014 13:20:41 +0000 (13:20 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Sep 2014 13:20:41 +0000 (13:20 +0000)
Added the header comment block to the function "RtcTimeFieldsValid()" and
reworked the alignment of the code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16011 6f19259b-4bc3-4df7-8a09-765794883524

EmbeddedPkg/Library/HalRuntimeServicesExampleLib/Rtc.c

index 6fd6516bf211b00705a6402444d5c29103950121..c35d72c03cabbedb1003a6661bb66232afb84f1f 100644 (file)
@@ -3,6 +3,7 @@
 \r
   Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2014, ARM Ltd. All rights reserved.\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -246,33 +247,33 @@ ConvertEfiTimeToRtcTime (
   }\r
 }\r
 \r
+/**\r
+  Check the validity of all the fields of a data structure of type EFI_TIME\r
+\r
+  @param[in]  Time  Pointer to a data structure of type EFI_TIME that defines a date and time\r
+\r
+  @retval  EFI_SUCCESS            All date and time fields are valid\r
+  @retval  EFI_INVALID_PARAMETER  At least one date or time field is not valid\r
+**/\r
 EFI_STATUS\r
 RtcTimeFieldsValid (\r
   IN EFI_TIME *Time\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Arguments:\r
-\r
-  Returns:\r
---*/\r
-// TODO:    Time - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
-  if (Time->Year < 1998 ||\r
-      Time->Year > 2099 ||\r
-      Time->Month < 1 ||\r
-      Time->Month > 12 ||\r
-      (!DayValid (Time)) ||\r
-      Time->Hour > 23 ||\r
-      Time->Minute > 59 ||\r
-      Time->Second > 59 ||\r
-      Time->Nanosecond > 999999999 ||\r
-      (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) ||\r
-      (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT)))\r
+  if ((Time->Year       < 1998     )                      ||\r
+      (Time->Year       > 2099     )                      ||\r
+      (Time->Month      < 1        )                      ||\r
+      (Time->Month      > 12       )                      ||\r
+      (!DayValid (Time))                                  ||\r
+      (Time->Hour       > 23       )                      ||\r
+      (Time->Minute     > 59       )                      ||\r
+      (Time->Second     > 59       )                      ||\r
+      (Time->Nanosecond > 999999999)                      ||\r
+      ((Time->TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&\r
+       ((Time->TimeZone < -1440) ||\r
+        (Time->TimeZone > 1440 )   )                  )  ||\r
+      (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT |\r
+                           EFI_TIME_IN_DAYLIGHT      )))\r
       ) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r