diff options
author | Gideon Israel Dsouza <gidisrael@gmail.com> | 2014-02-17 10:47:16 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-02-18 15:20:01 -0500 |
commit | e3ebf0d457039c857dfeb45434e3be9780dea499 (patch) | |
tree | be1abf341e59e52c6cdbc92c5e7af02df6cdc942 /block/partitions | |
parent | b4d7124b2f2e29541e5c8815bd84ea55158dd730 (diff) |
block: Use macros from compiler.h instead of __attribute__((...))
To increase compiler portability there are several macros defined
in <linux/compiler.h> for various gcc __attribute((..)) constructs.
I've made sure gcc these specific were replaced with the right
macro and an #include <linux/compiler.h> was placed where needed.
Signed-off-by: Gideon Israel Dsouza <gidisrael@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/partitions')
-rw-r--r-- | block/partitions/atari.h | 4 | ||||
-rw-r--r-- | block/partitions/efi.h | 9 | ||||
-rw-r--r-- | block/partitions/karma.c | 3 |
3 files changed, 10 insertions, 6 deletions
diff --git a/block/partitions/atari.h b/block/partitions/atari.h index fe2d32a89f36..f2ec43bfeec1 100644 --- a/block/partitions/atari.h +++ b/block/partitions/atari.h | |||
@@ -11,6 +11,8 @@ | |||
11 | * by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de) | 11 | * by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de) |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/compiler.h> | ||
15 | |||
14 | struct partition_info | 16 | struct partition_info |
15 | { | 17 | { |
16 | u8 flg; /* bit 0: active; bit 7: bootable */ | 18 | u8 flg; /* bit 0: active; bit 7: bootable */ |
@@ -29,6 +31,6 @@ struct rootsector | |||
29 | u32 bsl_st; /* start of bad sector list */ | 31 | u32 bsl_st; /* start of bad sector list */ |
30 | u32 bsl_cnt; /* length of bad sector list */ | 32 | u32 bsl_cnt; /* length of bad sector list */ |
31 | u16 checksum; /* checksum for bootable disks */ | 33 | u16 checksum; /* checksum for bootable disks */ |
32 | } __attribute__((__packed__)); | 34 | } __packed; |
33 | 35 | ||
34 | int atari_partition(struct parsed_partitions *state); | 36 | int atari_partition(struct parsed_partitions *state); |
diff --git a/block/partitions/efi.h b/block/partitions/efi.h index 4efcafba7e64..abd0b19288a6 100644 --- a/block/partitions/efi.h +++ b/block/partitions/efi.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/major.h> | 32 | #include <linux/major.h> |
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/efi.h> | 34 | #include <linux/efi.h> |
35 | #include <linux/compiler.h> | ||
35 | 36 | ||
36 | #define MSDOS_MBR_SIGNATURE 0xaa55 | 37 | #define MSDOS_MBR_SIGNATURE 0xaa55 |
37 | #define EFI_PMBR_OSTYPE_EFI 0xEF | 38 | #define EFI_PMBR_OSTYPE_EFI 0xEF |
@@ -87,13 +88,13 @@ typedef struct _gpt_header { | |||
87 | * | 88 | * |
88 | * uint8_t reserved2[ BlockSize - 92 ]; | 89 | * uint8_t reserved2[ BlockSize - 92 ]; |
89 | */ | 90 | */ |
90 | } __attribute__ ((packed)) gpt_header; | 91 | } __packed gpt_header; |
91 | 92 | ||
92 | typedef struct _gpt_entry_attributes { | 93 | typedef struct _gpt_entry_attributes { |
93 | u64 required_to_function:1; | 94 | u64 required_to_function:1; |
94 | u64 reserved:47; | 95 | u64 reserved:47; |
95 | u64 type_guid_specific:16; | 96 | u64 type_guid_specific:16; |
96 | } __attribute__ ((packed)) gpt_entry_attributes; | 97 | } __packed gpt_entry_attributes; |
97 | 98 | ||
98 | typedef struct _gpt_entry { | 99 | typedef struct _gpt_entry { |
99 | efi_guid_t partition_type_guid; | 100 | efi_guid_t partition_type_guid; |
@@ -102,7 +103,7 @@ typedef struct _gpt_entry { | |||
102 | __le64 ending_lba; | 103 | __le64 ending_lba; |
103 | gpt_entry_attributes attributes; | 104 | gpt_entry_attributes attributes; |
104 | efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; | 105 | efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; |
105 | } __attribute__ ((packed)) gpt_entry; | 106 | } __packed gpt_entry; |
106 | 107 | ||
107 | typedef struct _gpt_mbr_record { | 108 | typedef struct _gpt_mbr_record { |
108 | u8 boot_indicator; /* unused by EFI, set to 0x80 for bootable */ | 109 | u8 boot_indicator; /* unused by EFI, set to 0x80 for bootable */ |
@@ -124,7 +125,7 @@ typedef struct _legacy_mbr { | |||
124 | __le16 unknown; | 125 | __le16 unknown; |
125 | gpt_mbr_record partition_record[4]; | 126 | gpt_mbr_record partition_record[4]; |
126 | __le16 signature; | 127 | __le16 signature; |
127 | } __attribute__ ((packed)) legacy_mbr; | 128 | } __packed legacy_mbr; |
128 | 129 | ||
129 | /* Functions */ | 130 | /* Functions */ |
130 | extern int efi_partition(struct parsed_partitions *state); | 131 | extern int efi_partition(struct parsed_partitions *state); |
diff --git a/block/partitions/karma.c b/block/partitions/karma.c index 0ea19312706b..9721fa589bb1 100644 --- a/block/partitions/karma.c +++ b/block/partitions/karma.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include "check.h" | 9 | #include "check.h" |
10 | #include "karma.h" | 10 | #include "karma.h" |
11 | #include <linux/compiler.h> | ||
11 | 12 | ||
12 | int karma_partition(struct parsed_partitions *state) | 13 | int karma_partition(struct parsed_partitions *state) |
13 | { | 14 | { |
@@ -26,7 +27,7 @@ int karma_partition(struct parsed_partitions *state) | |||
26 | } d_partitions[2]; | 27 | } d_partitions[2]; |
27 | u8 d_blank[208]; | 28 | u8 d_blank[208]; |
28 | __le16 d_magic; | 29 | __le16 d_magic; |
29 | } __attribute__((packed)) *label; | 30 | } __packed *label; |
30 | struct d_partition *p; | 31 | struct d_partition *p; |
31 | 32 | ||
32 | data = read_part_sector(state, 0, §); | 33 | data = read_part_sector(state, 0, §); |