FatPkg/EnhancedFatDxe: Use global variable replace static local variable

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>
This commit is contained in:
Dandan Bi 2016-12-09 09:55:15 +08:00 committed by Ruiyu Ni
parent 5163b5f8d1
commit 3c8b45c8ee
1 changed files with 2 additions and 2 deletions

View File

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