From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C3F7381F94 for ; Thu, 8 Dec 2016 17:12:13 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP; 08 Dec 2016 17:12:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,322,1477983600"; d="scan'208";a="38406813" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 08 Dec 2016 17:12:13 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 17:12:13 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 17:12:12 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.11]) by shsmsx102.ccr.corp.intel.com ([169.254.2.37]) with mapi id 14.03.0248.002; Fri, 9 Dec 2016 09:12:09 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" Thread-Topic: [patch 4/8] FatPkg\EnhancedFatDxe: Make the variable name follow rule Thread-Index: AQHSUUGCUQx+wRGJXUqsWsF3FdR/DqD+z+vQ Date: Fri, 9 Dec 2016 01:12:08 +0000 Deferred-Delivery: Fri, 9 Dec 2016 01:12:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58EAFB59@SHSMSX104.ccr.corp.intel.com> References: <1481194467-75920-1-git-send-email-dandan.bi@intel.com> <1481194467-75920-5-git-send-email-dandan.bi@intel.com> In-Reply-To: <1481194467-75920-5-git-send-email-dandan.bi@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDYyMTJmNGMtOGU2NS00NjA4LTk4MWMtYjRhYTA2NmQxZjdkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJSelwvaGU0ejFzWVwvRFZhVWlYZFdmU09cL2lLdEVVV1RwbEZZMFMrTDlJSXNVPSJ9 x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 4/8] FatPkg\EnhancedFatDxe: Make the variable name follow rule X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 01:12:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Regards, Ray >-----Original Message----- >From: Bi, Dandan >Sent: Thursday, December 8, 2016 6:54 PM >To: edk2-devel@lists.01.org >Cc: Ni, Ruiyu >Subject: [patch 4/8] FatPkg\EnhancedFatDxe: Make the variable name follow = rule > >Cc: Ruiyu Ni >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Dandan Bi >--- > FatPkg/EnhancedFatDxe/DirectoryManage.c | 16 ++++----- > FatPkg/EnhancedFatDxe/DiskCache.c | 50 +++++++++++++-------------- > FatPkg/EnhancedFatDxe/Fat.h | 28 +++++++-------- > FatPkg/EnhancedFatDxe/FileSpace.c | 60 ++++++++++++++++------------= ----- > FatPkg/EnhancedFatDxe/Flush.c | 6 ++-- > FatPkg/EnhancedFatDxe/Init.c | 16 ++++----- > FatPkg/EnhancedFatDxe/Misc.c | 4 +-- > FatPkg/EnhancedFatDxe/ReadWrite.c | 20 +++++------ > 8 files changed, 100 insertions(+), 100 deletions(-) > >diff --git a/FatPkg/EnhancedFatDxe/DirectoryManage.c b/FatPkg/EnhancedFatD= xe/DirectoryManage.c >index 3328ae3..149119d 100644 >--- a/FatPkg/EnhancedFatDxe/DirectoryManage.c >+++ b/FatPkg/EnhancedFatDxe/DirectoryManage.c >@@ -58,11 +58,11 @@ Returns: > Position =3D EntryPos * sizeof (FAT_DIRECTORY_ENTRY); > if (Position >=3D Parent->FileSize) { > // > // End of directory > // >- ASSERT (IoMode =3D=3D READ_DATA); >+ ASSERT (IoMode =3D=3D ReadData); > ((FAT_DIRECTORY_ENTRY *) Entry)->FileName[0] =3D EMPTY_ENTRY_MARK; > ((FAT_DIRECTORY_ENTRY *) Entry)->Attributes =3D 0; > return EFI_SUCCESS; > } > >@@ -104,11 +104,11 @@ Returns: > EntryPos =3D DirEnt->EntryPos; > EntryCount =3D DirEnt->EntryCount; > // > // Write directory entry > // >- Status =3D FatAccessEntry (OFile, WRITE_DATA, EntryPos, &DirEnt->Entry)= ; >+ Status =3D FatAccessEntry (OFile, WriteData, EntryPos, &DirEnt->Entry); > if (EFI_ERROR (Status)) { > return Status; > } > > if (--EntryCount > 0) { >@@ -145,11 +145,11 @@ Returns: > EntryPos--; > if (DirEnt->Invalid) { > LfnEntry.Ordinal =3D DELETE_ENTRY_MARK; > } > >- Status =3D FatAccessEntry (OFile, WRITE_DATA, EntryPos, &LfnEntry); >+ Status =3D FatAccessEntry (OFile, WriteData, EntryPos, &LfnEntry); > if (EFI_ERROR (Status)) { > return Status; > } > } > } >@@ -320,11 +320,11 @@ Returns: > LfnBufferPointer =3D LfnBuffer; > break; > } > > EntryPos--; >- Status =3D FatAccessEntry (Parent, READ_DATA, EntryPos, &LfnEntry); >+ Status =3D FatAccessEntry (Parent, ReadData, EntryPos, &LfnEntry); > if (EFI_ERROR (Status) || > LfnEntry.Attributes !=3D FAT_ATTRIBUTE_LFN || > LfnEntry.MustBeZero !=3D 0 || > LfnEntry.Checksum !=3D LfnChecksum || > (LfnEntry.Ordinal & (~FAT_LFN_LAST)) !=3D LfnOrdinal || >@@ -440,11 +440,11 @@ Returns: > > for (;;) { > // > // Read the next directory entry until we find a valid directory entr= y (excluding lfn entry) > // >- Status =3D FatAccessEntry (OFile, READ_DATA, ODir->CurrentEndPos, &En= try); >+ Status =3D FatAccessEntry (OFile, ReadData, ODir->CurrentEndPos, &Ent= ry); > if (EFI_ERROR (Status)) { > return Status; > } > > if (((UINT8) Entry.FileName[0] !=3D DELETE_ENTRY_MARK) && (Entry.Attr= ibutes & FAT_ATTRIBUTE_VOLUME_ID) =3D=3D 0) { >@@ -460,11 +460,11 @@ Returns: > if (Entry.FileName[0] !=3D EMPTY_ENTRY_MARK) { > // > // Although FAT spec states this field is always 0 for FAT12 & FAT16,= some applications > // might use it for some special usage, it is safer to zero it in mem= ory for FAT12 & FAT16. > // >- if (OFile->Volume->FatType !=3D FAT32) { >+ if (OFile->Volume->FatType !=3D Fat32) { > Entry.FileClusterHigh =3D 0; > } > > // > // This is a valid directory entry >@@ -855,11 +855,11 @@ Returns: > > EntryPos =3D 0; > Entry =3D &DirEnt->Entry; > DirEnt->Invalid =3D TRUE; > do { >- Status =3D FatAccessEntry (Root, READ_DATA, EntryPos, Entry); >+ Status =3D FatAccessEntry (Root, ReadData, EntryPos, Entry); > if (EFI_ERROR (Status)) { > return Status; > } > > if (((UINT8) Entry->FileName[0] !=3D DELETE_ENTRY_MARK) && (((Entry->= Attributes) & (~FAT_ATTRIBUTE_ARCHIVE)) =3D=3D >FAT_ATTRIBUTE_VOLUME_ID)) { >@@ -1333,11 +1333,11 @@ Returns: > // The newly created OFile is root > // > Volume =3D VOLUME_FROM_ROOT_DIRENT (DirEnt); > Volume->Root =3D OFile; > OFile->FileCluster =3D Volume->RootCluster; >- if (Volume->FatType !=3D FAT32) { >+ if (Volume->FatType !=3D Fat32) { > OFile->IsFixedRootDir =3D TRUE; > } > } > > OFile->FileCurrentCluster =3D OFile->FileCluster; >diff --git a/FatPkg/EnhancedFatDxe/DiskCache.c b/FatPkg/EnhancedFatDxe/Dis= kCache.c >index ddf99ed..7f1fcf4 100644 >--- a/FatPkg/EnhancedFatDxe/DiskCache.c >+++ b/FatPkg/EnhancedFatDxe/DiskCache.c >@@ -68,11 +68,11 @@ Returns: > UINT8 PageAlignment; > DISK_CACHE *DiskCache; > CACHE_TAG *CacheTag; > UINT8 *BaseAddress; > >- DiskCache =3D &Volume->DiskCache[CACHE_DATA]; >+ DiskCache =3D &Volume->DiskCache[CacheData]; > BaseAddress =3D DiskCache->CacheBase; > GroupMask =3D DiskCache->GroupMask; > PageAlignment =3D DiskCache->PageAlignment; > PageSize =3D (UINTN)1 << PageAlignment; > >@@ -83,11 +83,11 @@ Returns: > // > // When reading data form disk directly, if some dirty data > // in cache is in this rang, this data in the Buffer need to > // be updated with the cache's dirty data. > // >- if (IoMode =3D=3D READ_DISK) { >+ if (IoMode =3D=3D ReadDisk) { > if (CacheTag->Dirty) { > CopyMem ( > Buffer + ((PageNo - StartPageNo) << PageAlignment), > BaseAddress + (GroupNo << PageAlignment), > PageSize >@@ -148,21 +148,21 @@ Returns: > GroupNo =3D PageNo & DiskCache->GroupMask; > PageAlignment =3D DiskCache->PageAlignment; > PageAddress =3D DiskCache->CacheBase + (GroupNo << PageAlignment); > EntryPos =3D DiskCache->BaseAddress + LShiftU64 (PageNo, PageAlign= ment); > RealSize =3D CacheTag->RealSize; >- if (IoMode =3D=3D READ_DISK) { >+ if (IoMode =3D=3D ReadDisk) { > RealSize =3D (UINTN)1 << PageAlignment; > MaxSize =3D DiskCache->LimitAddress - EntryPos; > if (MaxSize < RealSize) { > DEBUG ((EFI_D_INFO, "FatDiskIo: Cache Page OutBound occurred! \n"))= ; > RealSize =3D (UINTN) MaxSize; > } > } > > WriteCount =3D 1; >- if (DataType =3D=3D CACHE_FAT && IoMode =3D=3D WRITE_DISK) { >+ if (DataType =3D=3D CacheFat && IoMode =3D=3D WriteDisk) { > WriteCount =3D Volume->NumFats; > } > > do { > // >@@ -222,20 +222,20 @@ Returns: > > // > // Write dirty cache page back to disk > // > if (CacheTag->RealSize > 0 && CacheTag->Dirty) { >- Status =3D FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, C= acheTag, NULL); >+ Status =3D FatExchangeCachePage (Volume, CacheDataType, WriteDisk, Ca= cheTag, NULL); > if (EFI_ERROR (Status)) { > return Status; > } > } > // > // Load new data from disk; > // > CacheTag->PageNo =3D PageNo; >- Status =3D FatExchangeCachePage (Volume, CacheDataType, READ= _DISK, CacheTag, NULL); >+ Status =3D FatExchangeCachePage (Volume, CacheDataType, Read= Disk, CacheTag, NULL); > > return Status; > } > > STATIC >@@ -284,11 +284,11 @@ Returns: > CacheTag =3D &DiskCache->CacheTag[GroupNo]; > Status =3D FatGetCachePage (Volume, CacheDataType, PageNo, CacheTag)= ; > if (!EFI_ERROR (Status)) { > Source =3D DiskCache->CacheBase + (GroupNo << DiskCache->PageAli= gnment) + Offset; > Destination =3D Buffer; >- if (IoMode !=3D READ_DISK) { >+ if (IoMode !=3D ReadDisk) { > CacheTag->Dirty =3D TRUE; > DiskCache->Dirty =3D TRUE; > Destination =3D Source; > Source =3D Buffer; > } >@@ -389,11 +389,11 @@ Returns: > // > if (AlignedPageCount > 0) { > // > // Accessing fat table cannot have alignment data > // >- ASSERT (CacheDataType =3D=3D CACHE_DATA); >+ ASSERT (CacheDataType =3D=3D CacheData); > > EntryPos =3D Volume->RootPos + LShiftU64 (PageNo, PageAlignment); > AlignedSize =3D AlignedPageCount << PageAlignment; > Status =3D FatDiskIo (Volume, IoMode, EntryPos, AlignedSize, Buf= fer, Task); > if (EFI_ERROR (Status)) { >@@ -448,11 +448,11 @@ Returns: > UINTN GroupIndex; > UINTN GroupMask; > DISK_CACHE *DiskCache; > CACHE_TAG *CacheTag; > >- for (CacheDataType =3D (CACHE_DATA_TYPE) 0; CacheDataType < CACHE_MAX_T= YPE; CacheDataType++) { >+ for (CacheDataType =3D (CACHE_DATA_TYPE) 0; CacheDataType < CacheMaxTyp= e; CacheDataType++) { > DiskCache =3D &Volume->DiskCache[CacheDataType]; > if (DiskCache->Dirty) { > // > // Data cache or fat cache is dirty, write the dirty data back > // >@@ -461,11 +461,11 @@ Returns: > CacheTag =3D &DiskCache->CacheTag[GroupIndex]; > if (CacheTag->RealSize > 0 && CacheTag->Dirty) { > // > // Write back all Dirty Data Cache Page to disk > // >- Status =3D FatExchangeCachePage (Volume, CacheDataType, WRITE_D= ISK, CacheTag, Task); >+ Status =3D FatExchangeCachePage (Volume, CacheDataType, WriteDi= sk, CacheTag, Task); > if (EFI_ERROR (Status)) { > return Status; > } > } > } >@@ -509,36 +509,36 @@ Returns: > > DiskCache =3D Volume->DiskCache; > // > // Configure the parameters of disk cache > // >- if (Volume->FatType =3D=3D FAT12) { >+ if (Volume->FatType =3D=3D Fat12) { > FatCacheGroupCount =3D FAT_FATCACHE_GROUP_MIN_COUNT; >- DiskCache[CACHE_FAT].PageAlignment =3D FAT_FATCACHE_PAGE_MIN_ALIGNME= NT; >- DiskCache[CACHE_DATA].PageAlignment =3D FAT_DATACACHE_PAGE_MIN_ALIGNM= ENT; >+ DiskCache[CacheFat].PageAlignment =3D FAT_FATCACHE_PAGE_MIN_ALIGNMEN= T; >+ DiskCache[CacheData].PageAlignment =3D FAT_DATACACHE_PAGE_MIN_ALIGNME= NT; > } else { > FatCacheGroupCount =3D FAT_FATCACHE_GROUP_MAX_COUNT; >- DiskCache[CACHE_FAT].PageAlignment =3D FAT_FATCACHE_PAGE_MAX_ALIGNME= NT; >- DiskCache[CACHE_DATA].PageAlignment =3D FAT_DATACACHE_PAGE_MAX_ALIGNM= ENT; >+ DiskCache[CacheFat].PageAlignment =3D FAT_FATCACHE_PAGE_MAX_ALIGNMEN= T; >+ DiskCache[CacheData].PageAlignment =3D FAT_DATACACHE_PAGE_MAX_ALIGNME= NT; > } > >- DiskCache[CACHE_DATA].GroupMask =3D FAT_DATACACHE_GROUP_COUNT - 1; >- DiskCache[CACHE_DATA].BaseAddress =3D Volume->RootPos; >- DiskCache[CACHE_DATA].LimitAddress =3D Volume->VolumeSize; >- DiskCache[CACHE_FAT].GroupMask =3D FatCacheGroupCount - 1; >- DiskCache[CACHE_FAT].BaseAddress =3D Volume->FatPos; >- DiskCache[CACHE_FAT].LimitAddress =3D Volume->FatPos + Volume->FatSiz= e; >- FatCacheSize =3D FatCacheGroupCount << DiskCache= [CACHE_FAT].PageAlignment; >- DataCacheSize =3D FAT_DATACACHE_GROUP_COUNT << >DiskCache[CACHE_DATA].PageAlignment; >+ DiskCache[CacheData].GroupMask =3D FAT_DATACACHE_GROUP_COUNT - 1; >+ DiskCache[CacheData].BaseAddress =3D Volume->RootPos; >+ DiskCache[CacheData].LimitAddress =3D Volume->VolumeSize; >+ DiskCache[CacheFat].GroupMask =3D FatCacheGroupCount - 1; >+ DiskCache[CacheFat].BaseAddress =3D Volume->FatPos; >+ DiskCache[CacheFat].LimitAddress =3D Volume->FatPos + Volume->FatSize= ; >+ FatCacheSize =3D FatCacheGroupCount << DiskCache= [CacheFat].PageAlignment; >+ DataCacheSize =3D FAT_DATACACHE_GROUP_COUNT << >DiskCache[CacheData].PageAlignment; > // > // Allocate the Fat Cache buffer > // > CacheBuffer =3D AllocateZeroPool (FatCacheSize + DataCacheSize); > if (CacheBuffer =3D=3D NULL) { > return EFI_OUT_OF_RESOURCES; > } > > Volume->CacheBuffer =3D CacheBuffer; >- DiskCache[CACHE_FAT].CacheBase =3D CacheBuffer; >- DiskCache[CACHE_DATA].CacheBase =3D CacheBuffer + FatCacheSize; >+ DiskCache[CacheFat].CacheBase =3D CacheBuffer; >+ DiskCache[CacheData].CacheBase =3D CacheBuffer + FatCacheSize; > return EFI_SUCCESS; > } >diff --git a/FatPkg/EnhancedFatDxe/Fat.h b/FatPkg/EnhancedFatDxe/Fat.h >index b73135c..42aa647 100644 >--- a/FatPkg/EnhancedFatDxe/Fat.h >+++ b/FatPkg/EnhancedFatDxe/Fat.h >@@ -126,32 +126,32 @@ typedef CHAR8 LC_ISO_639_2; > > // > // The fat types we support > // > typedef enum { >- FAT12, >- FAT16, >- FAT32, >+ Fat12, >+ Fat16, >+ Fat32, > FatUndefined > } FAT_VOLUME_TYPE; > > typedef enum { >- CACHE_FAT, >- CACHE_DATA, >- CACHE_MAX_TYPE >+ CacheFat, >+ CacheData, >+ CacheMaxType > } CACHE_DATA_TYPE; > > // > // Used in FatDiskIo > // > typedef enum { >- READ_DISK =3D 0, // raw disk read >- WRITE_DISK =3D 1, // raw disk write >- READ_FAT =3D 2, // read fat cache >- WRITE_FAT =3D 3, // write fat cache >- READ_DATA =3D 6, // read data cache >- WRITE_DATA =3D 7 // write data cache >+ ReadDisk =3D 0, // raw disk read >+ WriteDisk =3D 1, // raw disk write >+ ReadFat =3D 2, // read fat cache >+ WriteFat =3D 3, // write fat cache >+ ReadData =3D 6, // read data cache >+ WriteData =3D 7 // write data cache > } IO_MODE; > > #define CACHE_ENABLED(a) ((a) >=3D 2) > #define RAW_ACCESS(a) ((IO_MODE)((a) & 0x1)) > #define CACHE_TYPE(a) ((CACHE_DATA_TYPE)((a) >> 2)) >@@ -382,11 +382,11 @@ typedef struct _FAT_VOLUME { > > // > // Disk Cache for this volume > // > VOID *CacheBuffer; >- DISK_CACHE DiskCache[CACHE_MAX_TYPE]; >+ DISK_CACHE DiskCache[CacheMaxType]; > } FAT_VOLUME; > > // > // Function Prototypes > // >@@ -1098,11 +1098,11 @@ FatResetODirCursor ( > IN FAT_OFILE *OFile > ); > > EFI_STATUS > FatGetNextDirEnt ( >- IN FAT_OFILE *OFILE, >+ IN FAT_OFILE *OFile, > OUT FAT_DIRENT **PtrDirEnt > ); > > EFI_STATUS > FatRemoveDirEnt ( >diff --git a/FatPkg/EnhancedFatDxe/FileSpace.c b/FatPkg/EnhancedFatDxe/Fil= eSpace.c >index ce7c067..db44a33 100644 >--- a/FatPkg/EnhancedFatDxe/FileSpace.c >+++ b/FatPkg/EnhancedFatDxe/FileSpace.c >@@ -57,15 +57,15 @@ Returns: > } > // > // Compute buffer position needed > // > switch (Volume->FatType) { >- case FAT12: >+ case Fat12: > Pos =3D FAT_POS_FAT12 (Index); > break; > >- case FAT16: >+ case Fat16: > Pos =3D FAT_POS_FAT16 (Index); > break; > > default: > Pos =3D FAT_POS_FAT32 (Index); >@@ -74,11 +74,11 @@ Returns: > // Set the position and read the buffer > // > Volume->FatEntryPos =3D Volume->FatPos + Pos; > Status =3D FatDiskIo ( > Volume, >- READ_FAT, >+ ReadFat, > Volume->FatEntryPos, > Volume->FatEntrySize, > &Volume->FatEntryBuffer, > NULL > ); >@@ -111,38 +111,38 @@ Returns: > The value of the FAT entry. > > --*/ > { > VOID *Pos; >- UINT8 *E12; >- UINT16 *E16; >- UINT32 *E32; >+ UINT8 *En12; >+ UINT16 *En16; >+ UINT32 *En32; > UINTN Accum; > > Pos =3D FatLoadFatEntry (Volume, Index); > > if (Index > (Volume->MaxCluster + 1)) { > return (UINTN) -1; > } > > switch (Volume->FatType) { >- case FAT12: >- E12 =3D Pos; >- Accum =3D E12[0] | (E12[1] << 8); >+ case Fat12: >+ En12 =3D Pos; >+ Accum =3D En12[0] | (En12[1] << 8); > Accum =3D FAT_ODD_CLUSTER_FAT12 (Index) ? (Accum >> 4) : (Accum & FAT= _CLUSTER_MASK_FAT12); > Accum =3D Accum | ((Accum >=3D FAT_CLUSTER_SPECIAL_FAT12) ? FAT_CLUST= ER_SPECIAL_EXT : 0); > break; > >- case FAT16: >- E16 =3D Pos; >- Accum =3D *E16; >+ case Fat16: >+ En16 =3D Pos; >+ Accum =3D *En16; > Accum =3D Accum | ((Accum >=3D FAT_CLUSTER_SPECIAL_FAT16) ? FAT_CLUST= ER_SPECIAL_EXT : 0); > break; > > default: >- E32 =3D Pos; >- Accum =3D *E32 & FAT_CLUSTER_MASK_FAT32; >+ En32 =3D Pos; >+ Accum =3D *En32 & FAT_CLUSTER_MASK_FAT32; > Accum =3D Accum | ((Accum >=3D FAT_CLUSTER_SPECIAL_FAT32) ? FAT_CLUST= ER_SPECIAL_EXT : 0); > } > > return Accum; > } >@@ -173,13 +173,13 @@ Returns: > other - An error occurred when operation the FAT entrie= s. > > --*/ > { > VOID *Pos; >- UINT8 *E12; >- UINT16 *E16; >- UINT32 *E32; >+ UINT8 *En12; >+ UINT16 *En16; >+ UINT32 *En32; > UINTN Accum; > EFI_STATUS Status; > UINTN OriginalVal; > > if (Index < FAT_MIN_CLUSTER) { >@@ -204,49 +204,49 @@ Returns: > > // > // Update the value > // > switch (Volume->FatType) { >- case FAT12: >- E12 =3D Pos; >- Accum =3D E12[0] | (E12[1] << 8); >+ case Fat12: >+ En12 =3D Pos; >+ Accum =3D En12[0] | (En12[1] << 8); > Value =3D Value & FAT_CLUSTER_MASK_FAT12; > > if (FAT_ODD_CLUSTER_FAT12 (Index)) { > Accum =3D (Value << 4) | (Accum & 0xF); > } else { > Accum =3D Value | (Accum & FAT_CLUSTER_UNMASK_FAT12); > } > >- E12[0] =3D (UINT8) (Accum & 0xFF); >- E12[1] =3D (UINT8) (Accum >> 8); >+ En12[0] =3D (UINT8) (Accum & 0xFF); >+ En12[1] =3D (UINT8) (Accum >> 8); > break; > >- case FAT16: >- E16 =3D Pos; >- *E16 =3D (UINT16) Value; >+ case Fat16: >+ En16 =3D Pos; >+ *En16 =3D (UINT16) Value; > break; > > default: >- E32 =3D Pos; >- *E32 =3D (*E32 & FAT_CLUSTER_UNMASK_FAT32) | (UINT32) (Value & FAT_C= LUSTER_MASK_FAT32); >+ En32 =3D Pos; >+ *En32 =3D (*En32 & FAT_CLUSTER_UNMASK_FAT32) | (UINT32) (Value & FAT= _CLUSTER_MASK_FAT32); > } > // > // If the volume's dirty bit is not set, set it now > // >- if (!Volume->FatDirty && Volume->FatType !=3D FAT12) { >+ if (!Volume->FatDirty && Volume->FatType !=3D Fat12) { > Volume->FatDirty =3D TRUE; >- FatAccessVolumeDirty (Volume, WRITE_FAT, &Volume->DirtyValue); >+ FatAccessVolumeDirty (Volume, WriteFat, &Volume->DirtyValue); > } > // > // Write the updated fat entry value to the volume > // The fat is the first fat, and other fat will be in sync > // when the FAT cache flush back. > // > Status =3D FatDiskIo ( > Volume, >- WRITE_FAT, >+ WriteFat, > Volume->FatEntryPos, > Volume->FatEntrySize, > &Volume->FatEntryBuffer, > NULL > ); >diff --git a/FatPkg/EnhancedFatDxe/Flush.c b/FatPkg/EnhancedFatDxe/Flush.c >index 2c960f3..172f202 100644 >--- a/FatPkg/EnhancedFatDxe/Flush.c >+++ b/FatPkg/EnhancedFatDxe/Flush.c >@@ -460,21 +460,21 @@ Returns: > // > // Update the free hint info. Volume->FreeInfoPos !=3D 0 > // indicates this a FAT32 volume > // > if (Volume->FreeInfoValid && Volume->FatDirty && Volume->FreeInfoPos)= { >- Status =3D FatDiskIo (Volume, WRITE_DISK, Volume->FreeInfoPos, size= of (FAT_INFO_SECTOR), &Volume->FatInfoSector, >Task); >+ Status =3D FatDiskIo (Volume, WriteDisk, Volume->FreeInfoPos, sizeo= f (FAT_INFO_SECTOR), &Volume->FatInfoSector, >Task); > if (EFI_ERROR (Status)) { > return Status; > } > } > // > // Update that the volume is not dirty > // >- if (Volume->FatDirty && Volume->FatType !=3D FAT12) { >+ if (Volume->FatDirty && Volume->FatType !=3D Fat12) { > Volume->FatDirty =3D FALSE; >- Status =3D FatAccessVolumeDirty (Volume, WRITE_FAT, &Vol= ume->NotDirtyValue); >+ Status =3D FatAccessVolumeDirty (Volume, WriteFat, &Volu= me->NotDirtyValue); > if (EFI_ERROR (Status)) { > return Status; > } > } > // >diff --git a/FatPkg/EnhancedFatDxe/Init.c b/FatPkg/EnhancedFatDxe/Init.c >index 34a7250..d7cfa82 100644 >--- a/FatPkg/EnhancedFatDxe/Init.c >+++ b/FatPkg/EnhancedFatDxe/Init.c >@@ -263,11 +263,11 @@ Returns: > } > > SectorsPerFat =3D FatBs.FatBsb.SectorsPerFat; > if (SectorsPerFat =3D=3D 0) { > SectorsPerFat =3D FatBs.FatBse.Fat32Bse.LargeSectorsPerFat; >- FatType =3D FAT32; >+ FatType =3D Fat32; > } > // > // Is boot sector a fat sector? > // (Note that so far we only know if the sector is FAT32 or not, we don= 't > // know if the sector is Fat16 or Fat12 until later when we can compute >@@ -303,11 +303,11 @@ Returns: > return EFI_UNSUPPORTED; > } > // > // Initialize fields the volume information for this FatType > // >- if (FatType !=3D FAT32) { >+ if (FatType !=3D Fat32) { > if (FatBs.FatBsb.RootEntries =3D=3D 0) { > return EFI_UNSUPPORTED; > } > // > // Unpack fat12, fat16 info >@@ -348,16 +348,16 @@ Returns: > Volume->ClusterSize =3D (UINTN)1 << (Volume->ClusterAlignment); > > // > // If this is not a fat32, determine if it's a fat16 or fat12 > // >- if (FatType !=3D FAT32) { >+ if (FatType !=3D Fat32) { > if (Volume->MaxCluster >=3D FAT_MAX_FAT16_CLUSTER) { > return EFI_VOLUME_CORRUPTED; > } > >- FatType =3D Volume->MaxCluster < FAT_MAX_FAT12_CLUSTER ? FAT12 : FAT1= 6; >+ FatType =3D Volume->MaxCluster < FAT_MAX_FAT12_CLUSTER ? Fat12 : Fat1= 6; > // > // fat12 & fat16 fat-entries are 2 bytes > // > Volume->FatEntrySize =3D sizeof (UINT16); > DirtyMask =3D FAT16_DIRTY_MASK; >@@ -374,25 +374,25 @@ Returns: > // > // Get the DirtyValue and NotDirtyValue > // We should keep the initial value as the NotDirtyValue > // in case the volume is dirty already > // >- if (FatType !=3D FAT12) { >- Status =3D FatAccessVolumeDirty (Volume, READ_DISK, &Volume->NotDirty= Value); >+ if (FatType !=3D Fat12) { >+ Status =3D FatAccessVolumeDirty (Volume, ReadDisk, &Volume->NotDirtyV= alue); > if (EFI_ERROR (Status)) { > return Status; > } > > Volume->DirtyValue =3D Volume->NotDirtyValue & DirtyMask; > } > // > // If present, read the fat hint info > // >- if (FatType =3D=3D FAT32) { >+ if (FatType =3D=3D Fat32) { > Volume->FreeInfoPos =3D FatBs.FatBse.Fat32Bse.FsInfoSector * BlockSiz= e; > if (FatBs.FatBse.Fat32Bse.FsInfoSector !=3D 0) { >- FatDiskIo (Volume, READ_DISK, Volume->FreeInfoPos, sizeof (FAT_INFO= _SECTOR), &Volume->FatInfoSector, NULL); >+ FatDiskIo (Volume, ReadDisk, Volume->FreeInfoPos, sizeof (FAT_INFO_= SECTOR), &Volume->FatInfoSector, NULL); > if (Volume->FatInfoSector.Signature =3D=3D FAT_INFO_SIGNATURE && > Volume->FatInfoSector.InfoBeginSignature =3D=3D FAT_INFO_BEGIN_= SIGNATURE && > Volume->FatInfoSector.InfoEndSignature =3D=3D FAT_INFO_END_SIGN= ATURE && > Volume->FatInfoSector.FreeInfo.ClusterCount <=3D Volume->MaxClu= ster > ) { >diff --git a/FatPkg/EnhancedFatDxe/Misc.c b/FatPkg/EnhancedFatDxe/Misc.c >index 6ad688c..48c99f9 100644 >--- a/FatPkg/EnhancedFatDxe/Misc.c >+++ b/FatPkg/EnhancedFatDxe/Misc.c >@@ -394,11 +394,11 @@ Returns: > if (Task =3D=3D NULL) { > // > // Blocking access > // > DiskIo =3D Volume->DiskIo; >- IoFunction =3D (IoMode =3D=3D READ_DISK) ? DiskIo->ReadDisk : Di= skIo->WriteDisk; >+ IoFunction =3D (IoMode =3D=3D ReadDisk) ? DiskIo->ReadDisk : Dis= kIo->WriteDisk; > Status =3D IoFunction (DiskIo, Volume->MediaId, Offset, Buff= erSize, Buffer); > } else { > // > // Non-blocking access > // >@@ -406,11 +406,11 @@ Returns: > if (Subtask =3D=3D NULL) { > Status =3D EFI_OUT_OF_RESOURCES; > } else { > Subtask->Signature =3D FAT_SUBTASK_SIGNATURE; > Subtask->Task =3D Task; >- Subtask->Write =3D (BOOLEAN) (IoMode =3D=3D WRITE_DISK); >+ Subtask->Write =3D (BOOLEAN) (IoMode =3D=3D WriteDisk); > Subtask->Offset =3D Offset; > Subtask->Buffer =3D Buffer; > Subtask->BufferSize =3D BufferSize; > Status =3D gBS->CreateEvent ( > EVT_NOTIFY_SIGNAL, >diff --git a/FatPkg/EnhancedFatDxe/ReadWrite.c b/FatPkg/EnhancedFatDxe/Rea= dWrite.c >index 9afb6bf..81676cd 100644 >--- a/FatPkg/EnhancedFatDxe/ReadWrite.c >+++ b/FatPkg/EnhancedFatDxe/ReadWrite.c >@@ -251,19 +251,19 @@ Returns: > Task =3D NULL; > > // > // Write to a directory is unsupported > // >- if ((OFile->ODir !=3D NULL) && (IoMode =3D=3D WRITE_DATA)) { >+ if ((OFile->ODir !=3D NULL) && (IoMode =3D=3D WriteData)) { > return EFI_UNSUPPORTED; > } > > if (OFile->Error =3D=3D EFI_NOT_FOUND) { > return EFI_DEVICE_ERROR; > } > >- if (IoMode =3D=3D READ_DATA) { >+ if (IoMode =3D=3D ReadData) { > // > // If position is at EOF, then return device error > // > if (IFile->Position > OFile->FileSize) { > return EFI_DEVICE_ERROR; >@@ -303,11 +303,11 @@ Returns: > if (!EFI_ERROR (Status)) { > if (OFile->ODir !=3D NULL) { > // > // Read a directory is supported > // >- ASSERT (IoMode =3D=3D READ_DATA); >+ ASSERT (IoMode =3D=3D ReadData); > Status =3D FatIFileReadDir (IFile, BufferSize, Buffer); > OFile =3D NULL; > } else { > // > // Access a file >@@ -315,11 +315,11 @@ Returns: > EndPosition =3D IFile->Position + *BufferSize; > if (EndPosition > OFile->FileSize) { > // > // The position goes beyond the end of file > // >- if (IoMode =3D=3D READ_DATA) { >+ if (IoMode =3D=3D ReadData) { > // > // Adjust the actual size read > // > *BufferSize -=3D (UINTN) EndPosition - OFile->FileSize; > } else { >@@ -399,11 +399,11 @@ Returns: > EFI_VOLUME_CORRUPTED - The file type of open file is error. > other - An error occurred when operation the disk. > > --*/ > { >- return FatIFileAccess (FHand, READ_DATA, BufferSize, Buffer, NULL); >+ return FatIFileAccess (FHand, ReadData, BufferSize, Buffer, NULL); > } > > EFI_STATUS > EFIAPI > FatReadEx ( >@@ -428,11 +428,11 @@ Returns: > EFI_VOLUME_CORRUPTED - The file type of open file is error. > other - An error occurred when operation the disk. > > --*/ > { >- return FatIFileAccess (FHand, READ_DATA, &Token->BufferSize, Token->Buf= fer, Token); >+ return FatIFileAccess (FHand, ReadData, &Token->BufferSize, Token->Buff= er, Token); > } > > EFI_STATUS > EFIAPI > FatWrite ( >@@ -462,11 +462,11 @@ Returns: > - The writing file size is larger than 4GB. > other - An error occurred when operation the disk. > > --*/ > { >- return FatIFileAccess (FHand, WRITE_DATA, BufferSize, Buffer, NULL); >+ return FatIFileAccess (FHand, WriteData, BufferSize, Buffer, NULL); > } > > EFI_STATUS > EFIAPI > FatWriteEx ( >@@ -491,11 +491,11 @@ Returns: > EFI_VOLUME_CORRUPTED - The file type of open file is error. > other - An error occurred when operation the disk. > > --*/ > { >- return FatIFileAccess (FHand, WRITE_DATA, &Token->BufferSize, Token->Bu= ffer, Token); >+ return FatIFileAccess (FHand, WriteData, &Token->BufferSize, Token->Buf= fer, Token); > } > > EFI_STATUS > FatAccessOFile ( > IN FAT_OFILE *OFile, >@@ -561,11 +561,11 @@ Returns: > // Data was successfully accessed > // > Position +=3D Len; > UserBuffer +=3D Len; > BufferSize -=3D Len; >- if (IoMode =3D=3D WRITE_DATA) { >+ if (IoMode =3D=3D WriteData) { > OFile->Dirty =3D TRUE; > OFile->Archive =3D TRUE; > } > // > // Make sure no outbound occurred >@@ -662,11 +662,11 @@ Returns: > } > > do { > WriteSize =3D AppendedSize > BufferSize ? BufferSize : (UINTN) Ap= pendedSize; > AppendedSize -=3D WriteSize; >- Status =3D FatAccessOFile (OFile, WRITE_DATA, WritePos, &WriteSize, Z= eroBuffer, NULL); >+ Status =3D FatAccessOFile (OFile, WriteData, WritePos, &WriteSize, Ze= roBuffer, NULL); > if (EFI_ERROR (Status)) { > break; > } > > WritePos +=3D WriteSize; >-- >1.9.5.msysgit.1