]> git.proxmox.com Git - mirror_edk2.git/commitdiff
FatPkg/EnhancedFatDxe: Use global variable replace static local variable
authorDandan Bi <dandan.bi@intel.com>
Fri, 9 Dec 2016 01:55:15 +0000 (09:55 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 9 Dec 2016 03:02:07 +0000 (11:02 +0800)
Create global variable "mMonthDays" to replace static local
variable "MonthDays" in FatIsValidTime() function in Misc.c.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
FatPkg/EnhancedFatDxe/Misc.c

index f91759c775c4d7119c7b7b59a268137d6ab10fe5..c7455a44123cb6d375f26ed0d0be07b138a207a7 100644 (file)
@@ -23,6 +23,7 @@ Revision History
 --*/\r
 \r
 #include "Fat.h"\r
+UINT8  mMonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\r
 \r
 FAT_TASK *\r
 FatCreateTask (\r
@@ -698,7 +699,6 @@ Returns:
 \r
 --*/\r
 {\r
-  static UINT8  MonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\r
   UINTN         Day;\r
   BOOLEAN       ValidTime;\r
 \r
@@ -725,7 +725,7 @@ Returns:
     //\r
     // Perform a more specific check of the day of the month\r
     //\r
-    Day = MonthDays[Time->Month - 1];\r
+    Day = mMonthDays[Time->Month - 1];\r
     if (Time->Month == 2 && IS_LEAP_YEAR (Time->Year)) {\r
       Day += 1;\r
       //\r