Commit e3ebf0d4 authored by Gideon Israel Dsouza's avatar Gideon Israel Dsouza Committed by Jens Axboe

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: default avatarGideon Israel Dsouza <gidisrael@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent b4d7124b
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de) * by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de)
*/ */
#include <linux/compiler.h>
struct partition_info struct partition_info
{ {
u8 flg; /* bit 0: active; bit 7: bootable */ u8 flg; /* bit 0: active; bit 7: bootable */
...@@ -29,6 +31,6 @@ struct rootsector ...@@ -29,6 +31,6 @@ struct rootsector
u32 bsl_st; /* start of bad sector list */ u32 bsl_st; /* start of bad sector list */
u32 bsl_cnt; /* length of bad sector list */ u32 bsl_cnt; /* length of bad sector list */
u16 checksum; /* checksum for bootable disks */ u16 checksum; /* checksum for bootable disks */
} __attribute__((__packed__)); } __packed;
int atari_partition(struct parsed_partitions *state); int atari_partition(struct parsed_partitions *state);
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <linux/compiler.h>
#define MSDOS_MBR_SIGNATURE 0xaa55 #define MSDOS_MBR_SIGNATURE 0xaa55
#define EFI_PMBR_OSTYPE_EFI 0xEF #define EFI_PMBR_OSTYPE_EFI 0xEF
...@@ -87,13 +88,13 @@ typedef struct _gpt_header { ...@@ -87,13 +88,13 @@ typedef struct _gpt_header {
* *
* uint8_t reserved2[ BlockSize - 92 ]; * uint8_t reserved2[ BlockSize - 92 ];
*/ */
} __attribute__ ((packed)) gpt_header; } __packed gpt_header;
typedef struct _gpt_entry_attributes { typedef struct _gpt_entry_attributes {
u64 required_to_function:1; u64 required_to_function:1;
u64 reserved:47; u64 reserved:47;
u64 type_guid_specific:16; u64 type_guid_specific:16;
} __attribute__ ((packed)) gpt_entry_attributes; } __packed gpt_entry_attributes;
typedef struct _gpt_entry { typedef struct _gpt_entry {
efi_guid_t partition_type_guid; efi_guid_t partition_type_guid;
...@@ -102,7 +103,7 @@ typedef struct _gpt_entry { ...@@ -102,7 +103,7 @@ typedef struct _gpt_entry {
__le64 ending_lba; __le64 ending_lba;
gpt_entry_attributes attributes; gpt_entry_attributes attributes;
efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; efi_char16_t partition_name[72 / sizeof (efi_char16_t)];
} __attribute__ ((packed)) gpt_entry; } __packed gpt_entry;
typedef struct _gpt_mbr_record { typedef struct _gpt_mbr_record {
u8 boot_indicator; /* unused by EFI, set to 0x80 for bootable */ u8 boot_indicator; /* unused by EFI, set to 0x80 for bootable */
...@@ -124,7 +125,7 @@ typedef struct _legacy_mbr { ...@@ -124,7 +125,7 @@ typedef struct _legacy_mbr {
__le16 unknown; __le16 unknown;
gpt_mbr_record partition_record[4]; gpt_mbr_record partition_record[4];
__le16 signature; __le16 signature;
} __attribute__ ((packed)) legacy_mbr; } __packed legacy_mbr;
/* Functions */ /* Functions */
extern int efi_partition(struct parsed_partitions *state); extern int efi_partition(struct parsed_partitions *state);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "check.h" #include "check.h"
#include "karma.h" #include "karma.h"
#include <linux/compiler.h>
int karma_partition(struct parsed_partitions *state) int karma_partition(struct parsed_partitions *state)
{ {
...@@ -26,7 +27,7 @@ int karma_partition(struct parsed_partitions *state) ...@@ -26,7 +27,7 @@ int karma_partition(struct parsed_partitions *state)
} d_partitions[2]; } d_partitions[2];
u8 d_blank[208]; u8 d_blank[208];
__le16 d_magic; __le16 d_magic;
} __attribute__((packed)) *label; } __packed *label;
struct d_partition *p; struct d_partition *p;
data = read_part_sector(state, 0, &sect); data = read_part_sector(state, 0, &sect);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment