From: "Yuwei Chen" <yuwei.chen@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"aladyshev22@gmail.com" <aladyshev22@gmail.com>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct alignment attributes display
Date: Fri, 22 Jul 2022 06:45:59 +0000 [thread overview]
Message-ID: <MW5PR11MB5906ADF4CCC05F1CEE2C551F96909@MW5PR11MB5906.namprd11.prod.outlook.com> (raw)
In-Reply-To: <4d14550122c0c144248dc788b288dedd5d15865b.1657717306.git.aladyshev22@gmail.com>
Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Konstantin Aladyshev
> Sent: Wednesday, July 13, 2022 9:11 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>;
> Konstantin Aladyshev <aladyshev22@gmail.com>
> Subject: [edk2-devel] [PATCH] BaseTools/VolInfo: Correct alignment
> attributes display
>
> Alignment attribute is not a bitmask, therefore we need to compare field
> value with all alignment defines.
> Remove duplicate print statements. Unify indent with other attribute print
> statements.
>
> Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
> ---
> BaseTools/Source/C/VolInfo/VolInfo.c | 198 +++++++++++++--------------
> 1 file changed, 96 insertions(+), 102 deletions(-)
>
> diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c
> b/BaseTools/Source/C/VolInfo/VolInfo.c
> index 2457ddd2e7..8b6fcffa48 100644
> --- a/BaseTools/Source/C/VolInfo/VolInfo.c
> +++ b/BaseTools/Source/C/VolInfo/VolInfo.c
> @@ -911,140 +911,134 @@ Returns:
> printf (" EFI_FVB2_WRITE_LOCK_STATUS\n"); } - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1) {+ switch
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT) {+ case
> EFI_FVB2_ALIGNMENT_1: printf (" EFI_FVB2_ALIGNMENT_1\n");- }-- if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {- printf ("
> EFI_FVB2_ALIGNMENT_2\n");- }-- if (VolumeHeader.Attributes &
> EFI_FVB2_ALIGNMENT_4) {- printf (" EFI_FVB2_ALIGNMENT_4\n");- }+
> break; - if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {- printf
> (" EFI_FVB2_ALIGNMENT_8\n");- }+ case EFI_FVB2_ALIGNMENT_2:+
> printf (" EFI_FVB2_ALIGNMENT_2\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16) {- printf ("
> EFI_FVB2_ALIGNMENT_16\n");- }+ case EFI_FVB2_ALIGNMENT_4:+
> printf (" EFI_FVB2_ALIGNMENT_4\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {- printf ("
> EFI_FVB2_ALIGNMENT_32\n");- }+ case EFI_FVB2_ALIGNMENT_8:+
> printf (" EFI_FVB2_ALIGNMENT_8\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64) {- printf ("
> EFI_FVB2_ALIGNMENT_64\n");- }+ case EFI_FVB2_ALIGNMENT_16:+
> printf (" EFI_FVB2_ALIGNMENT_16\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {- printf ("
> EFI_FVB2_ALIGNMENT_128\n");- }+ case EFI_FVB2_ALIGNMENT_32:+
> printf (" EFI_FVB2_ALIGNMENT_32\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {- printf ("
> EFI_FVB2_ALIGNMENT_256\n");- }+ case EFI_FVB2_ALIGNMENT_64:+
> printf (" EFI_FVB2_ALIGNMENT_64\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512) {- printf ("
> EFI_FVB2_ALIGNMENT_512\n");- }+ case EFI_FVB2_ALIGNMENT_128:+
> printf (" EFI_FVB2_ALIGNMENT_128\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1K) {- printf ("
> EFI_FVB2_ALIGNMENT_1K\n");- }+ case EFI_FVB2_ALIGNMENT_256:+
> printf (" EFI_FVB2_ALIGNMENT_256\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {- printf ("
> EFI_FVB2_ALIGNMENT_2K\n");- }+ case EFI_FVB2_ALIGNMENT_512:+
> printf (" EFI_FVB2_ALIGNMENT_512\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {- printf ("
> EFI_FVB2_ALIGNMENT_4K\n");- }+ case EFI_FVB2_ALIGNMENT_1K:+
> printf (" EFI_FVB2_ALIGNMENT_1K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8K) {- printf ("
> EFI_FVB2_ALIGNMENT_8K\n");- }+ case EFI_FVB2_ALIGNMENT_2K:+
> printf (" EFI_FVB2_ALIGNMENT_2K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {- printf ("
> EFI_FVB2_ALIGNMENT_16K\n");- }+ case EFI_FVB2_ALIGNMENT_4K:+
> printf (" EFI_FVB2_ALIGNMENT_4K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {- printf ("
> EFI_FVB2_ALIGNMENT_32K\n");- }+ case EFI_FVB2_ALIGNMENT_8K:+
> printf (" EFI_FVB2_ALIGNMENT_8K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64K) {- printf ("
> EFI_FVB2_ALIGNMENT_64K\n");- }+ case EFI_FVB2_ALIGNMENT_16K:+
> printf (" EFI_FVB2_ALIGNMENT_16K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128K) {- printf ("
> EFI_FVB2_ALIGNMENT_128K\n");- }+ case EFI_FVB2_ALIGNMENT_32K:+
> printf (" EFI_FVB2_ALIGNMENT_32K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256K) {- printf ("
> EFI_FVB2_ALIGNMENT_256K\n");- }+ case EFI_FVB2_ALIGNMENT_64K:+
> printf (" EFI_FVB2_ALIGNMENT_64K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {- printf ("
> EFI_FVB2_ALIGNMENT_512K\n");- }+ case EFI_FVB2_ALIGNMENT_128K:+
> printf (" EFI_FVB2_ALIGNMENT_128K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {- printf ("
> EFI_FVB2_ALIGNMENT_1M\n");- }+ case EFI_FVB2_ALIGNMENT_256K:+
> printf (" EFI_FVB2_ALIGNMENT_256K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2M) {- printf ("
> EFI_FVB2_ALIGNMENT_2M\n");- }+ case EFI_FVB2_ALIGNMENT_512K:+
> printf (" EFI_FVB2_ALIGNMENT_512K\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4M) {- printf ("
> EFI_FVB2_ALIGNMENT_4M\n");- }+ case EFI_FVB2_ALIGNMENT_1M:+
> printf (" EFI_FVB2_ALIGNMENT_1M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8M) {- printf ("
> EFI_FVB2_ALIGNMENT_8M\n");- }+ case EFI_FVB2_ALIGNMENT_2M:+
> printf (" EFI_FVB2_ALIGNMENT_2M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16M) {- printf ("
> EFI_FVB2_ALIGNMENT_16M\n");- }+ case EFI_FVB2_ALIGNMENT_4M:+
> printf (" EFI_FVB2_ALIGNMENT_4M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32M) {- printf ("
> EFI_FVB2_ALIGNMENT_32M\n");- }+ case EFI_FVB2_ALIGNMENT_8M:+
> printf (" EFI_FVB2_ALIGNMENT_8M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {- printf ("
> EFI_FVB2_ALIGNMENT_64M\n");- }+ case EFI_FVB2_ALIGNMENT_16M:+
> printf (" EFI_FVB2_ALIGNMENT_16M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {- printf ("
> EFI_FVB2_ALIGNMENT_128M\n");- }+ case EFI_FVB2_ALIGNMENT_32M:+
> printf (" EFI_FVB2_ALIGNMENT_32M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {- printf ("
> EFI_FVB2_ALIGNMENT_64M\n");- }+ case EFI_FVB2_ALIGNMENT_64M:+
> printf (" EFI_FVB2_ALIGNMENT_64M\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {- printf ("
> EFI_FVB2_ALIGNMENT_128M\n");- }+ case
> EFI_FVB2_ALIGNMENT_128M:+ printf ("
> EFI_FVB2_ALIGNMENT_128M\n");+ break; - if (VolumeHeader.Attributes
> & EFI_FVB2_ALIGNMENT_256M) {- printf ("
> EFI_FVB2_ALIGNMENT_256M\n");- }+ case
> EFI_FVB2_ALIGNMENT_256M:+ printf ("
> EFI_FVB2_ALIGNMENT_256M\n");+ break; - if (VolumeHeader.Attributes
> & EFI_FVB2_ALIGNMENT_512M) {- printf ("
> EFI_FVB2_ALIGNMENT_512M\n");- }+ case
> EFI_FVB2_ALIGNMENT_512M:+ printf ("
> EFI_FVB2_ALIGNMENT_512M\n");+ break; - if (VolumeHeader.Attributes
> & EFI_FVB2_ALIGNMENT_1G) {- printf ("
> EFI_FVB2_ALIGNMENT_1G\n");- }+ case EFI_FVB2_ALIGNMENT_1G:+
> printf (" EFI_FVB2_ALIGNMENT_1G\n");+ break; - if
> (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2G) {- printf ("
> EFI_FVB2_ALIGNMENT_2G\n");+ case EFI_FVB2_ALIGNMENT_2G:+ printf
> (" EFI_FVB2_ALIGNMENT_2G\n");+ break; } #endif--
> 2.25.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#91311): https://edk2.groups.io/g/devel/message/91311
> Mute This Topic: https://groups.io/mt/92356890/4546272
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [yuwei.chen@intel.com]
> -=-=-=-=-=-=
>
next prev parent reply other threads:[~2022-07-22 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 13:11 [PATCH] BaseTools/VolInfo: Correct alignment attributes display Konstantin Aladyshev
2022-07-22 6:45 ` Yuwei Chen [this message]
2022-07-24 5:28 ` Bob Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW5PR11MB5906ADF4CCC05F1CEE2C551F96909@MW5PR11MB5906.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox