From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 5C11E81F92 for ; Thu, 8 Dec 2016 17:11:12 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 08 Dec 2016 17:11:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,322,1477983600"; d="scan'208";a="1079487376" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 08 Dec 2016 17:11:11 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 17:11:11 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 17:11:11 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.11]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.206]) with mapi id 14.03.0248.002; Fri, 9 Dec 2016 09:11:09 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" Thread-Topic: [patch 5/8] FatPkg\EnhancedFatDxe: Use typedef for complex type Thread-Index: AQHSUUGDd7rXmAycXE2CgUUjQtOe86D+z4SQ Date: Fri, 9 Dec 2016 01:11:08 +0000 Deferred-Delivery: Fri, 9 Dec 2016 01:11:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58EAFB36@SHSMSX104.ccr.corp.intel.com> References: <1481194467-75920-1-git-send-email-dandan.bi@intel.com> <1481194467-75920-6-git-send-email-dandan.bi@intel.com> In-Reply-To: <1481194467-75920-6-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODA1ODAxZDktMTQzNi00NjE0LThmMDEtMTcwZTc2NDAwNmY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJoSFdVK2tYMEhOU2Q4M2hQdktZVkVYWWxRZjhZNnoxQ1RkNDJpQVwvTHN4cz0ifQ== x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 5/8] FatPkg\EnhancedFatDxe: Use typedef for complex type 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:11:12 -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 5/8] FatPkg\EnhancedFatDxe: Use typedef for complex type > >Cc: Ruiyu Ni >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Dandan Bi >--- > FatPkg/EnhancedFatDxe/Fat.h | 36 ++++++++++++++++++++----------= ----- > FatPkg/EnhancedFatDxe/FatFileSystem.h | 10 ++++++---- > 2 files changed, 27 insertions(+), 19 deletions(-) > >diff --git a/FatPkg/EnhancedFatDxe/Fat.h b/FatPkg/EnhancedFatDxe/Fat.h >index 42aa647..f49acee 100644 >--- a/FatPkg/EnhancedFatDxe/Fat.h >+++ b/FatPkg/EnhancedFatDxe/Fat.h >@@ -182,42 +182,48 @@ typedef struct { > #define HASH_TABLE_MASK (HASH_TABLE_SIZE - 1) > > // > // The directory entry for opened directory > // >-typedef struct _FAT_DIRENT { >+ >+typedef struct _FAT_DIRENT FAT_DIRENT; >+typedef struct _FAT_ODIR FAT_ODIR; >+typedef struct _FAT_OFILE FAT_OFILE; >+typedef struct _FAT_VOLUME FAT_VOLUME; >+ >+struct _FAT_DIRENT { > UINTN Signature; > UINT16 EntryPos; // The position of this dir= ectory entry in the parent directory file > UINT8 EntryCount; // The count of the directo= ry entry in the parent directory file > BOOLEAN Invalid; // Indicate whether this di= rectory entry is valid > CHAR16 *FileString; // The unicode long file na= me for this directory entry >- struct _FAT_OFILE *OFile; // The OFile of the corresp= onding directory entry >- struct _FAT_DIRENT *ShortNameForwardLink; // Hash successor link for = short filename >- struct _FAT_DIRENT *LongNameForwardLink; // Hash successor link for = long filename >+ FAT_OFILE *OFile; // The OFile of the corresp= onding directory entry >+ FAT_DIRENT *ShortNameForwardLink; // Hash successor link for = short filename >+ FAT_DIRENT *LongNameForwardLink; // Hash successor link for = long filename > LIST_ENTRY Link; // Connection of every dire= ctory entry > FAT_DIRECTORY_ENTRY Entry; // The physical directory e= ntry stored in disk >-} FAT_DIRENT; >+}; > >-typedef struct _FAT_ODIR { >+struct _FAT_ODIR { > UINTN Signature; > UINT32 CurrentEndPos; // Current end position of = the directory > UINT32 CurrentPos; // Current position of the = directory > LIST_ENTRY *CurrentCursor; // Current directory entry = pointer > LIST_ENTRY ChildList; // List of all directory en= tries > BOOLEAN EndOfDir; // Indicate whether we have= reached the end of the directory > LIST_ENTRY DirCacheLink; // Linked in Volume->DirCac= heList when discarded > UINTN DirCacheTag; // The identification of th= e directory when in directory cache > FAT_DIRENT *LongNameHashTable[HASH_TABLE_SIZE]; > FAT_DIRENT *ShortNameHashTable[HASH_TABLE_SIZE]; >-} FAT_ODIR; >+}; > > typedef struct { > UINTN Signature; > EFI_FILE_PROTOCOL Handle; > UINT64 Position; > BOOLEAN ReadOnly; >- struct _FAT_OFILE *OFile; >+ FAT_OFILE *OFile; > LIST_ENTRY Tasks; // List of all FAT_TASKs > LIST_ENTRY Link; // Link to other IFiles > } FAT_IFILE; > > typedef struct { >@@ -240,13 +246,13 @@ typedef struct { > } FAT_SUBTASK; > > // > // FAT_OFILE - Each opened file > // >-typedef struct _FAT_OFILE { >+struct _FAT_OFILE { > UINTN Signature; >- struct _FAT_VOLUME *Volume; >+ FAT_VOLUME *Volume; > // > // A permanant error code to return to all accesses to > // this opened file > // > EFI_STATUS Error; >@@ -282,11 +288,11 @@ typedef struct _FAT_OFILE { > UINT64 PosDisk; // on the disk > UINTN PosRem; // remaining in this disk run > // > // The opened parent, full path length and currently opened child files > // >- struct _FAT_OFILE *Parent; >+ FAT_OFILE *Parent; > UINTN FullPathLen; > LIST_ENTRY ChildHead; > LIST_ENTRY ChildLink; > > // >@@ -301,13 +307,13 @@ typedef struct _FAT_OFILE { > > // > // Link in Volume's reference list > // > LIST_ENTRY CheckLink; >-} FAT_OFILE; >+}; > >-typedef struct _FAT_VOLUME { >+struct _FAT_VOLUME { > UINTN Signature; > > EFI_HANDLE Handle; > BOOLEAN Valid; > BOOLEAN DiskError; >@@ -364,11 +370,11 @@ typedef struct _FAT_VOLUME { > FAT_DIRENT RootDirEnt; > // > // File Name of root OFile, it is empty string > // > CHAR16 RootFileString[1]; >- struct _FAT_OFILE *Root; >+ FAT_OFILE *Root; > > // > // New OFiles are added to this list so they > // can be cleaned up if they aren't referenced. > // >@@ -383,11 +389,11 @@ typedef struct _FAT_VOLUME { > // > // Disk Cache for this volume > // > VOID *CacheBuffer; > DISK_CACHE DiskCache[CacheMaxType]; >-} FAT_VOLUME; >+}; > > // > // Function Prototypes > // > EFI_STATUS >diff --git a/FatPkg/EnhancedFatDxe/FatFileSystem.h b/FatPkg/EnhancedFatDxe= /FatFileSystem.h >index bcef258..3f89a34 100644 >--- a/FatPkg/EnhancedFatDxe/FatFileSystem.h >+++ b/FatPkg/EnhancedFatDxe/FatFileSystem.h >@@ -144,16 +144,18 @@ typedef struct { > CHAR8 Id[4]; > CHAR8 FatLabel[11]; > CHAR8 SystemId[8]; > } FAT32_BOOT_SECTOR_EXT; > >-typedef struct { >- FAT_BOOT_SECTOR_BASIC FatBsb; >- union { >+typedef union { > FAT_BOOT_SECTOR_EXT FatBse; > FAT32_BOOT_SECTOR_EXT Fat32Bse; >- } FatBse; >+ } FAT_BSE; >+ >+typedef struct { >+ FAT_BOOT_SECTOR_BASIC FatBsb; >+ FAT_BSE FatBse; > } FAT_BOOT_SECTOR; > > // > // FAT Info Structure > // >-- >1.9.5.msysgit.1