From nobody Thu Dec 26 13:36:04 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1505451498143630.614097084; Thu, 14 Sep 2017 21:58:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9923A21EA35BC; Thu, 14 Sep 2017 21:55:08 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 B657E21E977FF for ; Thu, 14 Sep 2017 21:55:07 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:07 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:06 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114505" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:53 +0800 Message-Id: <20170915045753.588-8-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 7/7] MdeModulePkg/UdfDxe: Refine enum member naming style X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Similar to the naming style for variables, it's better for the name of members in a enum type to avoid using only upper-case letters. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 62 ++++++++++-= --------- MdeModulePkg/Universal/Disk/UdfDxe/Udf.h | 28 ++++----- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index dfbf6b3f95..5df267761f 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -710,9 +710,9 @@ GetLongAdFromAds ( // If it's either an indirect AD (Extended Alllocation Descriptor) or = an // allocated AD, then return it. // - ExtentFlags =3D GET_EXTENT_FLAGS (LONG_ADS_SEQUENCE, LongAd); - if (ExtentFlags =3D=3D EXTENT_IS_NEXT_EXTENT || - ExtentFlags =3D=3D EXTENT_RECORDED_AND_ALLOCATED) { + ExtentFlags =3D GET_EXTENT_FLAGS (LongAdsSequence, LongAd); + if (ExtentFlags =3D=3D ExtentIsNextExtent || + ExtentFlags =3D=3D ExtentRecordedAndAllocated) { break; } =20 @@ -720,7 +720,7 @@ GetLongAdFromAds ( // This AD is either not recorded but allocated, or not recorded and n= ot // allocated. Skip it. // - *Offset +=3D AD_LENGTH (LONG_ADS_SEQUENCE); + *Offset +=3D AD_LENGTH (LongAdsSequence); } =20 *FoundLongAd =3D LongAd; @@ -766,9 +766,9 @@ GetShortAdFromAds ( // If it's either an indirect AD (Extended Alllocation Descriptor) or = an // allocated AD, then return it. // - ExtentFlags =3D GET_EXTENT_FLAGS (SHORT_ADS_SEQUENCE, ShortAd); - if (ExtentFlags =3D=3D EXTENT_IS_NEXT_EXTENT || - ExtentFlags =3D=3D EXTENT_RECORDED_AND_ALLOCATED) { + ExtentFlags =3D GET_EXTENT_FLAGS (ShortAdsSequence, ShortAd); + if (ExtentFlags =3D=3D ExtentIsNextExtent || + ExtentFlags =3D=3D ExtentRecordedAndAllocated) { break; } =20 @@ -776,7 +776,7 @@ GetShortAdFromAds ( // This AD is either not recorded but allocated, or not recorded and n= ot // allocated. Skip it. // - *Offset +=3D AD_LENGTH (SHORT_ADS_SEQUENCE); + *Offset +=3D AD_LENGTH (ShortAdsSequence); } =20 *FoundShortAd =3D ShortAd; @@ -808,14 +808,14 @@ GetAllocationDescriptor ( OUT VOID **FoundAd ) { - if (RecordingFlags =3D=3D LONG_ADS_SEQUENCE) { + if (RecordingFlags =3D=3D LongAdsSequence) { return GetLongAdFromAds ( Data, Offset, Length, (UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd ); - } else if (RecordingFlags =3D=3D SHORT_ADS_SEQUENCE) { + } else if (RecordingFlags =3D=3D ShortAdsSequence) { return GetShortAdFromAds ( Data, Offset, @@ -846,9 +846,9 @@ GetAllocationDescriptorLsn ( IN VOID *Ad ) { - if (RecordingFlags =3D=3D LONG_ADS_SEQUENCE) { + if (RecordingFlags =3D=3D LongAdsSequence) { return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad); - } else if (RecordingFlags =3D=3D SHORT_ADS_SEQUENCE) { + } else if (RecordingFlags =3D=3D ShortAdsSequence) { return GetShortAdLsn ( GetPdFromLongAd (Volume, ParentIcb), (UDF_SHORT_ALLOCATION_DESCRIPTOR *)Ad @@ -1115,8 +1115,8 @@ ReadFile ( Data =3D NULL; =20 switch (ReadFileInfo->Flags) { - case READ_FILE_GET_FILESIZE: - case READ_FILE_ALLOCATE_AND_READ: + case ReadFileGetFileSize: + case ReadFileAllocateAndRead: // // Initialise ReadFileInfo structure for either getting file size, or // reading file's recorded data. @@ -1124,7 +1124,7 @@ ReadFile ( ReadFileInfo->ReadLength =3D 0; ReadFileInfo->FileData =3D NULL; break; - case READ_FILE_SEEK_AND_READ: + case ReadFileSeekAndRead: // // About to seek a file and/or read its data. // @@ -1149,15 +1149,15 @@ ReadFile ( =20 RecordingFlags =3D GET_FE_RECORDING_FLAGS (FileEntryData); switch (RecordingFlags) { - case INLINE_DATA: + case InlineData: // // There are no extents for this FE/EFE. All data is inline. // GetFileEntryData (FileEntryData, &Data, &Length); =20 - if (ReadFileInfo->Flags =3D=3D READ_FILE_GET_FILESIZE) { + if (ReadFileInfo->Flags =3D=3D ReadFileGetFileSize) { ReadFileInfo->ReadLength =3D Length; - } else if (ReadFileInfo->Flags =3D=3D READ_FILE_ALLOCATE_AND_READ) { + } else if (ReadFileInfo->Flags =3D=3D ReadFileAllocateAndRead) { // // Allocate buffer for starting read data. // @@ -1171,7 +1171,7 @@ ReadFile ( // CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length); ReadFileInfo->ReadLength =3D Length; - } else if (ReadFileInfo->Flags =3D=3D READ_FILE_SEEK_AND_READ) { + } else if (ReadFileInfo->Flags =3D=3D ReadFileSeekAndRead) { // // If FilePosition is non-zero, seek file to FilePosition, read // FileDataSize bytes and then updates FilePosition. @@ -1191,8 +1191,8 @@ ReadFile ( Status =3D EFI_SUCCESS; break; =20 - case LONG_ADS_SEQUENCE: - case SHORT_ADS_SEQUENCE: + case LongAdsSequence: + case ShortAdsSequence: // // This FE/EFE contains a run of Allocation Descriptors. Get data + si= ze // for start reading them out. @@ -1220,7 +1220,7 @@ ReadFile ( // Check if AD is an indirect AD. If so, read Allocation Extent // Descriptor and its extents (ADs). // - if (GET_EXTENT_FLAGS (RecordingFlags, Ad) =3D=3D EXTENT_IS_NEXT_EXTE= NT) { + if (GET_EXTENT_FLAGS (RecordingFlags, Ad) =3D=3D ExtentIsNextExtent)= { if (!DoFreeAed) { DoFreeAed =3D TRUE; } else { @@ -1254,10 +1254,10 @@ ReadFile ( Ad); =20 switch (ReadFileInfo->Flags) { - case READ_FILE_GET_FILESIZE: + case ReadFileGetFileSize: ReadFileInfo->ReadLength +=3D ExtentLength; break; - case READ_FILE_ALLOCATE_AND_READ: + case ReadFileAllocateAndRead: // // Increase FileData (if necessary) to read next extent. // @@ -1288,7 +1288,7 @@ ReadFile ( =20 ReadFileInfo->ReadLength +=3D ExtentLength; break; - case READ_FILE_SEEK_AND_READ: + case ReadFileSeekAndRead: // // Seek file first before reading in its data. // @@ -1364,7 +1364,7 @@ ReadFile ( } =20 break; - case EXTENDED_ADS_SEQUENCE: + case ExtendedAdsSequence: // FIXME: Not supported. Got no volume with it, yet. ASSERT (FALSE); Status =3D EFI_UNSUPPORTED; @@ -1388,7 +1388,7 @@ Done: =20 Error_Read_Disk_Blk: Error_Alloc_Buffer_To_Next_Ad: - if (ReadFileInfo->Flags !=3D READ_FILE_SEEK_AND_READ) { + if (ReadFileInfo->Flags !=3D ReadFileSeekAndRead) { FreePool (ReadFileInfo->FileData); } =20 @@ -1911,7 +1911,7 @@ ReadDirectoryEntry ( // The directory's recorded data has not been read yet. So let's cache= it // into memory and the next calls won't need to read it again. // - ReadFileInfo.Flags =3D READ_FILE_ALLOCATE_AND_READ; + ReadFileInfo.Flags =3D ReadFileAllocateAndRead; =20 Status =3D ReadFile ( BlockIo, @@ -2061,7 +2061,7 @@ ResolveSymlink ( // all its data here -- usually the data will be inline with the FE/EFE = for // lower filenames. // - ReadFileInfo.Flags =3D READ_FILE_ALLOCATE_AND_READ; + ReadFileInfo.Flags =3D ReadFileAllocateAndRead; =20 Status =3D ReadFile ( BlockIo, @@ -2284,7 +2284,7 @@ GetFileSize ( EFI_STATUS Status; UDF_READ_FILE_INFO ReadFileInfo; =20 - ReadFileInfo.Flags =3D READ_FILE_GET_FILESIZE; + ReadFileInfo.Flags =3D ReadFileGetFileSize; =20 Status =3D ReadFile ( BlockIo, @@ -2610,7 +2610,7 @@ ReadFileData ( EFI_STATUS Status; UDF_READ_FILE_INFO ReadFileInfo; =20 - ReadFileInfo.Flags =3D READ_FILE_SEEK_AND_READ; + ReadFileInfo.Flags =3D ReadFileSeekAndRead; ReadFileInfo.FilePosition =3D *FilePosition; ReadFileInfo.FileData =3D Buffer; ReadFileInfo.FileDataSize =3D *BufferSize; diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h b/MdeModulePkg/Univer= sal/Disk/UdfDxe/Udf.h index 641e0ae267..44c843fd4d 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h @@ -106,10 +106,10 @@ !IS_FID_PARENT_FILE (_Pointer))) =20 typedef enum { - SHORT_ADS_SEQUENCE, - LONG_ADS_SEQUENCE, - EXTENDED_ADS_SEQUENCE, - INLINE_DATA + ShortAdsSequence, + LongAdsSequence, + ExtendedAdsSequence, + InlineData } UDF_FE_RECORDING_FLAGS; =20 #define GET_FE_RECORDING_FLAGS(_Fe) \ @@ -118,26 +118,26 @@ typedef enum { sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07) =20 typedef enum { - EXTENT_RECORDED_AND_ALLOCATED, - EXTENT_NOT_RECORDED_BUT_ALLOCATED, - EXTENT_NOT_RECORDED_NOT_ALLOCATED, - EXTENT_IS_NEXT_EXTENT, + ExtentRecordedAndAllocated, + ExtentNotRecordedButAllocated, + ExtentNotRecordedNotAllocated, + ExtentIsNextExtent, } UDF_EXTENT_FLAGS; =20 #define AD_LENGTH(_RecFlags) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \ ((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR)))) =20 #define GET_EXTENT_FLAGS(_RecFlags, _Ad) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->Extent= Length >> \ 30) & 0x3)) : \ ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentL= ength >> \ 30) & 0x3))) =20 #define GET_EXTENT_LENGTH(_RecFlags, _Ad) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \ ~0xC0000000UL))) : \ ((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \ @@ -169,9 +169,9 @@ typedef struct { #pragma pack() =20 typedef enum { - READ_FILE_GET_FILESIZE, - READ_FILE_ALLOCATE_AND_READ, - READ_FILE_SEEK_AND_READ, + ReadFileGetFileSize, + ReadFileAllocateAndRead, + ReadFileSeekAndRead, } UDF_READ_FILE_FLAGS; =20 typedef struct { --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel