disk: Address cast and format errors
[oweals/u-boot.git] / disk / part_efi.h
index 6bbb06bde904450f7d4d0332eb8925ec8be5870a..4e28d1dcb66c1e15d8b9b8f40b2ba9b61ca7c896 100644 (file)
@@ -111,19 +111,25 @@ typedef struct _gpt_header {
        unsigned char reserved2[GPT_BLOCK_SIZE - 92];
 } __attribute__ ((packed)) gpt_header;
 
-typedef struct _gpt_entry_attributes {
-       unsigned long long required_to_function:1;
-       unsigned long long reserved:47;
-       unsigned long long type_guid_specific:16;
+typedef union _gpt_entry_attributes {
+       struct {
+               unsigned long long required_to_function:1;
+               unsigned long long no_block_io_protocol:1;
+               unsigned long long legacy_bios_bootable:1;
+               unsigned long long reserved:45;
+               unsigned long long type_guid_specific:16;
+       } fields;
+       unsigned long long raw;
 } __attribute__ ((packed)) gpt_entry_attributes;
 
+#define PARTNAME_SZ    (72 / sizeof(efi_char16_t))
 typedef struct _gpt_entry {
        efi_guid_t partition_type_guid;
        efi_guid_t unique_partition_guid;
        unsigned char starting_lba[8];
        unsigned char ending_lba[8];
        gpt_entry_attributes attributes;
-       efi_char16_t partition_name[72 / sizeof(efi_char16_t)];
+       efi_char16_t partition_name[PARTNAME_SZ];
 }
 __attribute__ ((packed)) gpt_entry;