* [PATCH v2 2/8] FatPkg/EnhancedFatDxe: Use global variable replace static local variable
@ 2016-12-09 2:20 Dandan Bi
2016-12-09 2:43 ` Ni, Ruiyu
0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2016-12-09 2:20 UTC (permalink / raw)
To: edk2-devel; +Cc: Ruiyu Ni
Create global variable "mMonthDays" to replace static local
variable "MonthDays" in function FatIsValidTime() 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>
---
FatPkg/EnhancedFatDxe/Misc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/FatPkg/EnhancedFatDxe/Misc.c b/FatPkg/EnhancedFatDxe/Misc.c
index f91759c..c7455a4 100644
--- a/FatPkg/EnhancedFatDxe/Misc.c
+++ b/FatPkg/EnhancedFatDxe/Misc.c
@@ -21,10 +21,11 @@ Abstract:
Revision History
--*/
#include "Fat.h"
+UINT8 mMonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
FAT_TASK *
FatCreateTask (
FAT_IFILE *IFile,
EFI_FILE_IO_TOKEN *Token
@@ -696,11 +697,10 @@ Returns:
TRUE - The time is valid.
FALSE - The time is not valid.
--*/
{
- static UINT8 MonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
UINTN Day;
BOOLEAN ValidTime;
ValidTime = TRUE;
@@ -723,11 +723,11 @@ Returns:
} else {
//
// 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)) {
Day += 1;
//
// 1 extra day this month
//
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 2/8] FatPkg/EnhancedFatDxe: Use global variable replace static local variable
2016-12-09 2:20 [PATCH v2 2/8] FatPkg/EnhancedFatDxe: Use global variable replace static local variable Dandan Bi
@ 2016-12-09 2:43 ` Ni, Ruiyu
0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ruiyu @ 2016-12-09 2:43 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Regards,
Ray
>-----Original Message-----
>From: Bi, Dandan
>Sent: Friday, December 9, 2016 10:21 AM
>To: edk2-devel@lists.01.org
>Cc: Ni, Ruiyu <ruiyu.ni@intel.com>
>Subject: [PATCH v2 2/8] FatPkg/EnhancedFatDxe: Use global variable replace static local variable
>
>Create global variable "mMonthDays" to replace static local
>variable "MonthDays" in function FatIsValidTime() 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>
>---
> FatPkg/EnhancedFatDxe/Misc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/FatPkg/EnhancedFatDxe/Misc.c b/FatPkg/EnhancedFatDxe/Misc.c
>index f91759c..c7455a4 100644
>--- a/FatPkg/EnhancedFatDxe/Misc.c
>+++ b/FatPkg/EnhancedFatDxe/Misc.c
>@@ -21,10 +21,11 @@ Abstract:
> Revision History
>
> --*/
>
> #include "Fat.h"
>+UINT8 mMonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
>
> FAT_TASK *
> FatCreateTask (
> FAT_IFILE *IFile,
> EFI_FILE_IO_TOKEN *Token
>@@ -696,11 +697,10 @@ Returns:
> TRUE - The time is valid.
> FALSE - The time is not valid.
>
> --*/
> {
>- static UINT8 MonthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
> UINTN Day;
> BOOLEAN ValidTime;
>
> ValidTime = TRUE;
>
>@@ -723,11 +723,11 @@ Returns:
>
> } else {
> //
> // 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)) {
> Day += 1;
> //
> // 1 extra day this month
> //
>--
>1.9.5.msysgit.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-09 2:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-09 2:20 [PATCH v2 2/8] FatPkg/EnhancedFatDxe: Use global variable replace static local variable Dandan Bi
2016-12-09 2:43 ` Ni, Ruiyu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox