Rename __attribute__((packed)) --> __packed

Also unify __attribute__ ((..)) to __attribute__((..)) and
handle ((__packed__)) like ((packed))

Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/15921
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/drivers/elog/boot_count.c b/src/drivers/elog/boot_count.c
index 9d717d8..6e9fcab 100644
--- a/src/drivers/elog/boot_count.c
+++ b/src/drivers/elog/boot_count.c
@@ -18,6 +18,7 @@
 #include <pc80/mc146818rtc.h>
 #include <stddef.h>
 #include <stdint.h>
+#include <compiler.h>
 #include <elog.h>
 
 /*
@@ -43,7 +44,7 @@
 	u16 signature;
 	u32 count;
 	u16 checksum;
-} __attribute__ ((packed));
+} __packed;
 
 /* Read and validate boot count structure from CMOS */
 static int boot_count_cmos_read(struct boot_count *bc)
diff --git a/src/drivers/elog/elog_internal.h b/src/drivers/elog/elog_internal.h
index a09bbef..3ccee90c 100644
--- a/src/drivers/elog/elog_internal.h
+++ b/src/drivers/elog/elog_internal.h
@@ -16,13 +16,14 @@
 #ifndef ELOG_INTERNAL_H_
 #define ELOG_INTERNAL_H_
 
+#include <compiler.h>
 /* ELOG header */
 struct elog_header {
 	u32 magic;
 	u8 version;
 	u8 header_size;
 	u8 reserved[2];
-} __attribute__ ((packed));
+} __packed;
 
 /* ELOG related constants */
 #define ELOG_SIGNATURE			0x474f4c45  /* 'ELOG' */
@@ -40,7 +41,7 @@
 	u8 hour;
 	u8 minute;
 	u8 second;
-} __attribute__ ((packed));
+} __packed;
 
 /* SMBIOS Type 15 related constants */
 #define ELOG_HEADER_TYPE_OEM		0x88
diff --git a/src/drivers/elog/gsmi.c b/src/drivers/elog/gsmi.c
index f125d23..cd94cf61b 100644
--- a/src/drivers/elog/gsmi.c
+++ b/src/drivers/elog/gsmi.c
@@ -13,6 +13,7 @@
  * GNU General Public License for more details.
  */
 
+#include <compiler.h>
 #include <arch/io.h>
 #include <console/console.h>
 #include <cpu/x86/smm.h>
@@ -33,17 +34,17 @@
 	u32 data_ptr;
 	u32 data_len;
 	u32 type;
-} __attribute__ ((packed));
+} __packed;
 
 struct gsmi_set_eventlog_type1 {
 	u16 type;
 	u32 instance;
-} __attribute__ ((packed));
+} __packed;
 
 struct gsmi_clear_eventlog_param {
 	u32 percentage;
 	u32 data_type;
-} __attribute__ ((packed));
+} __packed;
 
 /* Param is usually EBX, ret in EAX */
 u32 gsmi_exec(u8 command, u32 *param)
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c
index aa59f1e..3505dce 100644
--- a/src/drivers/i2c/tpm/cr50.c
+++ b/src/drivers/i2c/tpm/cr50.c
@@ -57,7 +57,7 @@
 
 static struct tpm_inf_dev g_tpm_dev CAR_GLOBAL;
 
-__attribute__ ((weak)) int tis_plat_irq_status(void)
+__attribute__((weak)) int tis_plat_irq_status(void)
 {
 	static int warning_displayed CAR_GLOBAL;
 
diff --git a/src/drivers/i2c/tpm/tis_atmel.c b/src/drivers/i2c/tpm/tis_atmel.c
index 7d8b7a1..b6e1351 100644
--- a/src/drivers/i2c/tpm/tis_atmel.c
+++ b/src/drivers/i2c/tpm/tis_atmel.c
@@ -14,6 +14,7 @@
 
 #include <arch/early_variables.h>
 #include <stdint.h>
+#include <compiler.h>
 #include <string.h>
 #include <assert.h>
 #include <commonlib/endian.h>
@@ -33,7 +34,7 @@
 	uint16_t tag;
 	uint32_t length;
 	uint32_t return_code;
-} __attribute__ ((packed));
+} __packed;
 
 int tis_open(void)
 {
diff --git a/src/drivers/intel/fsp1_0/fsp_util.c b/src/drivers/intel/fsp1_0/fsp_util.c
index b43f0df..fc1bd51 100644
--- a/src/drivers/intel/fsp1_0/fsp_util.c
+++ b/src/drivers/intel/fsp1_0/fsp_util.c
@@ -66,7 +66,7 @@
  * Call the FSP to do memory init. The FSP doesn't return to this function.
  * The FSP returns to the romstage_main_continue().
  */
-void __attribute__ ((noreturn)) fsp_early_init (FSP_INFO_HEADER *fsp_ptr)
+void __attribute__((noreturn)) fsp_early_init (FSP_INFO_HEADER *fsp_ptr)
 {
 	FSP_FSP_INIT FspInitApi;
 	FSP_INIT_PARAMS FspInitParams;
diff --git a/src/drivers/intel/fsp1_0/fsp_util.h b/src/drivers/intel/fsp1_0/fsp_util.h
index bbdd4de..badd254 100644
--- a/src/drivers/intel/fsp1_0/fsp_util.h
+++ b/src/drivers/intel/fsp1_0/fsp_util.h
@@ -16,6 +16,7 @@
 #ifndef FSP_UTIL_H
 #define FSP_UTIL_H
 
+#include <compiler.h>
 #include <chipset_fsp_util.h>
 #include "fsp_values.h"
 
@@ -71,7 +72,7 @@
 	u32	mrc_checksum;	// IP style checksum
 	u32	reserved;		// For header alignment
 	u8	mrc_data[0];	// Variable size, platform/run time dependent.
-} __attribute__ ((packed));
+} __packed;
 
 struct mrc_data_container *find_current_mrc_cache(void);
 
diff --git a/src/drivers/intel/fsp1_1/fsp_util.c b/src/drivers/intel/fsp1_1/fsp_util.c
index 8b23c4a..34d6e48 100644
--- a/src/drivers/intel/fsp1_1/fsp_util.c
+++ b/src/drivers/intel/fsp1_1/fsp_util.c
@@ -14,6 +14,7 @@
  * GNU General Public License for more details.
  */
 
+#include <compiler.h>
 #include <bootstate.h>
 #include <cbmem.h>
 #include <console/console.h>
@@ -185,7 +186,7 @@
 struct fsp_runtime {
 	uint32_t fih;
 	uint32_t hob_list;
-} __attribute__((packed));
+} __packed;
 
 
 void fsp_set_runtime(FSP_INFO_HEADER *fih, void *hob_list)
diff --git a/src/drivers/intel/fsp1_1/include/fsp/gma.h b/src/drivers/intel/fsp1_1/include/fsp/gma.h
index b0a2e7a..55b09dc 100644
--- a/src/drivers/intel/fsp1_1/include/fsp/gma.h
+++ b/src/drivers/intel/fsp1_1/include/fsp/gma.h
@@ -18,6 +18,7 @@
 #define _GMA_H_
 
 #include <types.h>
+#include <compiler.h>
 
 /* IGD PCI Configuration register */
 #define ASLS		0xfc		/* OpRegion Base */
@@ -35,7 +36,7 @@
 	u8	driver_version[16];
 	u32	mailboxes;
 	u8	reserved[164];
-} __attribute__((packed)) opregion_header_t;
+} __packed opregion_header_t;
 
 #define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 #define IGD_OPREGION_VERSION  2
@@ -72,7 +73,7 @@
 	u32	cnot;
 	u32	nrdy;
 	u8	reserved2[60];
-} __attribute__((packed)) opregion_mailbox1_t;
+} __packed opregion_mailbox1_t;
 
 /* mailbox 2: software sci interface */
 typedef struct {
@@ -80,7 +81,7 @@
 	u32	parm;
 	u32	dslp;
 	u8	reserved[244];
-} __attribute__((packed)) opregion_mailbox2_t;
+} __packed opregion_mailbox2_t;
 
 /* mailbox 3: power conservation */
 typedef struct {
@@ -99,7 +100,7 @@
 	u32	ccdv;
 	u32	pcft;
 	u8	reserved[94];
-} __attribute__((packed)) opregion_mailbox3_t;
+} __packed opregion_mailbox3_t;
 
 #define IGD_BACKLIGHT_BRIGHTNESS 0xff
 #define IGD_INITIAL_BRIGHTNESS 0x64
@@ -111,7 +112,7 @@
 /* mailbox 4: vbt */
 typedef struct {
 	u8 gvd1[7168];
-} __attribute__((packed)) opregion_vbt_t;
+} __packed opregion_vbt_t;
 
 /* IGD OpRegion */
 typedef struct {
@@ -120,7 +121,7 @@
 	opregion_mailbox2_t mailbox2;
 	opregion_mailbox3_t mailbox3;
 	opregion_vbt_t vbt;
-} __attribute__((packed)) igd_opregion_t;
+} __packed igd_opregion_t;
 
 /* Intel Video BIOS (Option ROM) */
 typedef struct {
@@ -129,7 +130,7 @@
 	u8	reserved[21];
 	u16	pcir_offset;
 	u16	vbt_offset;
-} __attribute__((packed)) optionrom_header_t;
+} __packed optionrom_header_t;
 
 #define OPROM_SIGNATURE 0xaa55
 
@@ -146,7 +147,7 @@
 	u8  codetype;
 	u8  indicator;
 	u16 reserved2;
-} __attribute__((packed)) optionrom_pcir_t;
+} __packed optionrom_pcir_t;
 
 typedef struct {
 	u8  hdr_signature[20];
@@ -170,7 +171,7 @@
 	u8  coreblock_integratedhw;
 	u8  coreblock_biosbuild[4];
 	u8  coreblock_biossignon[155];
-} __attribute__((packed)) optionrom_vbt_t;
+} __packed optionrom_vbt_t;
 
 #define VBT_SIGNATURE 0x54425624
 
diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c
index cfd3d16..3207e1d 100644
--- a/src/drivers/intel/fsp2_0/graphics.c
+++ b/src/drivers/intel/fsp2_0/graphics.c
@@ -10,6 +10,7 @@
  * (at your option) any later version.
  */
 
+#include <compiler.h>
 #include <cbfs.h>
 #include <console/console.h>
 #include <fsp/util.h>
@@ -37,7 +38,7 @@
 	uint32_t blue_mask;
 	uint32_t reserved_mask;
 	uint32_t pixels_per_scanline;
-} __attribute__((packed));
+} __packed;
 
 struct pixel {
 	uint8_t pos;
diff --git a/src/drivers/intel/fsp2_0/hob_display.c b/src/drivers/intel/fsp2_0/hob_display.c
index 7257aec..67e79b4 100644
--- a/src/drivers/intel/fsp2_0/hob_display.c
+++ b/src/drivers/intel/fsp2_0/hob_display.c
@@ -9,13 +9,14 @@
  * (at your option) any later version.
  */
 
+#include <compiler.h>
 #include <console/console.h>
 #include <fsp/util.h>
 
 struct hob_type_name {
 	uint16_t type;
 	const char *name;
-} __attribute__((packed));
+} __packed;
 
 static const struct hob_type_name hob_type_names[] = {
 	{ HOB_TYPE_HANDOFF, "HOB_TYPE_HANDOFF" },
diff --git a/src/drivers/intel/fsp2_0/include/fsp/upd.h b/src/drivers/intel/fsp2_0/include/fsp/upd.h
index 651170f..580257b 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/upd.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/upd.h
@@ -12,6 +12,8 @@
 #ifndef _FSP2_0_UPD_H_
 #define _FSP2_0_UPD_H_
 
+#include <compiler.h>
+
 struct FSP_UPD_HEADER {
 	///
 	/// UPD Region Signature. This signature will be
@@ -26,7 +28,7 @@
 	///
 	uint8_t                       Revision;
 	uint8_t                       Reserved[23];
-} __attribute__((packed));
+} __packed;
 
 struct FSPM_ARCH_UPD {
 	///
@@ -59,6 +61,6 @@
 	///
 	uint32_t                      BootMode;
 	uint8_t                       Reserved1[8];
-} __attribute__((packed));
+} __packed;
 
 #endif /* _FSP2_0_UPD_H_ */
diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h
index 86e637c..402d48b 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/util.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/util.h
@@ -13,6 +13,7 @@
 #ifndef _FSP2_0_UTIL_H_
 #define _FSP2_0_UTIL_H_
 
+#include <compiler.h>
 #include <boot/coreboot_tables.h>
 #include <commonlib/region.h>
 #include <arch/cpu.h>
@@ -23,7 +24,7 @@
 struct hob_header {
 	uint16_t type;
 	uint16_t length;
-} __attribute__((packed));
+} __packed;
 
 struct fsp_notify_params {
 	enum fsp_notify_phase phase;
@@ -35,7 +36,7 @@
 	uint32_t attribute_type;
 	uint64_t addr;
 	uint64_t length;
-} __attribute__((packed));
+} __packed;
 
 enum resource_type {
 	EFI_RESOURCE_SYSTEM_MEMORY		= 0,
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c
index 424a325..43888c1 100644
--- a/src/drivers/intel/fsp2_0/memory_init.c
+++ b/src/drivers/intel/fsp2_0/memory_init.c
@@ -11,6 +11,7 @@
  * (at your option) any later version.
  */
 
+#include <compiler.h>
 #include <antirollback.h>
 #include <arch/io.h>
 #include <arch/cpu.h>
@@ -281,13 +282,13 @@
 	return CB_SUCCESS;
 }
 
-__attribute__ ((weak))
+__attribute__((weak))
 uint8_t fsp_memory_mainboard_version(void)
 {
 	return 0;
 }
 
-__attribute__ ((weak))
+__attribute__((weak))
 uint8_t fsp_memory_soc_version(void)
 {
 	return 0;
diff --git a/src/drivers/intel/gma/intel_bios.h b/src/drivers/intel/gma/intel_bios.h
index 2e1211b..048985d 100644
--- a/src/drivers/intel/gma/intel_bios.h
+++ b/src/drivers/intel/gma/intel_bios.h
@@ -28,6 +28,8 @@
 #ifndef _I830_BIOS_H_
 #define _I830_BIOS_H_
 
+#include <compiler.h>
+
 struct vbt_header {
 	u8 signature[20];		/**< Always starts with 'VBT$' */
 	u16 version;			/**< decimal */
@@ -37,7 +39,7 @@
 	u8 reserved0;
 	u32 bdb_offset;			/**< from beginning of VBT */
 	u32 aim_offset[4];		/**< from beginning of VBT */
-} __attribute__((packed));
+} __packed;
 
 struct bdb_header {
 	u8 signature[16];		/**< Always 'BIOS_DATA_BLOCK' */
@@ -63,7 +65,7 @@
 	u8 rsvd4; /* popup memory size */
 	u8 resize_pci_bios;
 	u8 rsvd5; /* is crt already on ddc2 */
-} __attribute__((packed));
+} __packed;
 
 /*
  * There are several types of BIOS data blocks (BDBs), each block has
@@ -140,7 +142,7 @@
 	u8 dp_ssc_enb:1;	/* PCH attached eDP supports SSC */
 	u8 dp_ssc_freq:1;	/* SSC freq for PCH attached eDP */
 	u8 rsvd11:3; /* finish byte */
-} __attribute__((packed));
+} __packed;
 
 /* pre-915 */
 #define GPIO_PIN_DVI_LVDS	0x03 /* "DVI/LVDS DDC GPIO pins" */
@@ -223,7 +225,7 @@
 	u8  dvo2_wiring;
 	u16 extended_type;
 	u8  dvo_function;
-} __attribute__((packed));
+} __packed;
 
 /* This one contains field offsets that are known to be common for all BDB
  * versions. Notice that the meaning of the contents contents may still change,
@@ -236,7 +238,7 @@
 	u8 not_common2[2];
 	u8 ddc_pin;
 	u16 edid_ptr;
-} __attribute__((packed));
+} __packed;
 
 /* This field changes depending on the BDB version, so the most reliable way to
  * read it is by checking the BDB version and reading the raw pointer. */
@@ -277,7 +279,7 @@
 	 *	     sizeof(child_device_config);
 	 */
 	union child_device_config devices[0];
-} __attribute__((packed));
+} __packed;
 
 struct bdb_lvds_options {
 	u8 panel_type;
@@ -291,7 +293,7 @@
 	u8 lvds_edid:1;
 	u8 rsvd2:1;
 	u8 rsvd4;
-} __attribute__((packed));
+} __packed;
 
 /* LFP pointer table contains entries to the struct below */
 struct bdb_lvds_lfp_data_ptr {
@@ -301,12 +303,12 @@
 	u8 dvo_table_size;
 	u16 panel_pnp_id_offset;
 	u8 pnp_table_size;
-} __attribute__((packed));
+} __packed;
 
 struct bdb_lvds_lfp_data_ptrs {
 	u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */
 	struct bdb_lvds_lfp_data_ptr ptr[16];
-} __attribute__((packed));
+} __packed;
 
 /* LFP data has 3 blocks per entry */
 struct lvds_fp_timing {
@@ -323,7 +325,7 @@
 	u32 pfit_reg;
 	u32 pfit_reg_val;
 	u16 terminator;
-} __attribute__((packed));
+} __packed;
 
 struct lvds_dvo_timing {
 	u16 clock;		/**< In 10khz */
@@ -351,7 +353,7 @@
 	u8 vsync_positive:1;
 	u8 hsync_positive:1;
 	u8 rsvd2:1;
-} __attribute__((packed));
+} __packed;
 
 struct lvds_pnp_id {
 	u16 mfg_name;
@@ -359,17 +361,17 @@
 	u32 serial;
 	u8 mfg_week;
 	u8 mfg_year;
-} __attribute__((packed));
+} __packed;
 
 struct bdb_lvds_lfp_data_entry {
 	struct lvds_fp_timing fp_timing;
 	struct lvds_dvo_timing dvo_timing;
 	struct lvds_pnp_id pnp_id;
-} __attribute__((packed));
+} __packed;
 
 struct bdb_lvds_lfp_data {
 	struct bdb_lvds_lfp_data_entry data[16];
-} __attribute__((packed));
+} __packed;
 
 struct aimdb_header {
 	char signature[16];
@@ -377,12 +379,12 @@
 	u16 aimdb_version;
 	u16 aimdb_header_size;
 	u16 aimdb_size;
-} __attribute__((packed));
+} __packed;
 
 struct aimdb_block {
 	u8 aimdb_id;
 	u16 aimdb_size;
-} __attribute__((packed));
+} __packed;
 
 struct vch_panel_data {
 	u16 fp_timing_offset;
@@ -393,12 +395,12 @@
 	u8 text_fitting_size;
 	u16 graphics_fitting_offset;
 	u8 graphics_fitting_size;
-} __attribute__((packed));
+} __packed;
 
 struct vch_bdb_22 {
 	struct aimdb_block aimdb_block;
 	struct vch_panel_data panels[16];
-} __attribute__((packed));
+} __packed;
 
 struct bdb_sdvo_lvds_options {
 	u8 panel_backlight;
@@ -414,7 +416,7 @@
 	u8 panel_misc_bits_2;
 	u8 panel_misc_bits_3;
 	u8 panel_misc_bits_4;
-} __attribute__((packed));
+} __packed;
 
 
 #define BDB_DRIVER_FEATURE_NO_LVDS		0
@@ -460,7 +462,7 @@
 
 	u8 hdmi_termination;
 	u8 custom_vbt_version;
-} __attribute__((packed));
+} __packed;
 
 #define EDP_18BPP	0
 #define EDP_24BPP	1
@@ -485,14 +487,14 @@
 	u16 t9;
 	u16 t10;
 	u16 t11_t12;
-} __attribute__ ((packed));
+} __packed;
 
 struct edp_link_params {
 	u8 rate:4;
 	u8 lanes:4;
 	u8 preemphasis:4;
 	u8 vswing:4;
-} __attribute__ ((packed));
+} __packed;
 
 struct bdb_edp {
 	struct edp_power_seq power_seqs[16];
@@ -503,7 +505,7 @@
 	/* ith bit indicates enabled/disabled for (i+1)th panel */
 	u16 edp_s3d_feature;
 	u16 edp_t3_optimization;
-} __attribute__ ((packed));
+} __packed;
 
 /*
  * Driver<->VBIOS interaction occurs through scratch bits in
@@ -728,7 +730,7 @@
 	u32 hl_switch_cnt;
 	u32 lp_byte_clk;
 	u32 clk_lane_switch_cnt;
-} __attribute__((packed));
+} __packed;
 
 #define VBT_SIGNATURE 0x54425624
 
diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h
index 7c7107a..10c1691 100644
--- a/src/drivers/intel/gma/opregion.h
+++ b/src/drivers/intel/gma/opregion.h
@@ -19,6 +19,7 @@
 #define _COMMON_GMA_H_
 
 #include <types.h>
+#include <compiler.h>
 #include <commonlib/helpers.h>
 
 /* IGD PCI Configuration register */
@@ -40,7 +41,7 @@
 	u32	pcon;		    /* Offset 96   Platform Capabilities */
 	u16	dver[16];	    /* Offset 100  GOP Version */
 	u8	reserved[124];	    /* Offset 132  Reserved */
-} __attribute__((packed)) opregion_header_t;
+} __packed opregion_header_t;
 
 #define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 #define IGD_OPREGION_VERSION  2
@@ -121,7 +122,7 @@
 	u32	cp14;	/* Offset 244  Extended Currently present device 6 */
 	u32	cp15;	/* Offset 248  Extended Currently present device 7 */
 	u8	reserved2[4];	/* Offset 252  Reserved 4 bytes */
-} __attribute__((packed)) opregion_mailbox1_t;
+} __packed opregion_mailbox1_t;
 
 /* mailbox 2: software sci interface */
 typedef struct {
@@ -129,7 +130,7 @@
 	u32	parm;	/* Offset 4  Software SCI function number parameters */
 	u32	dslp;	/* Offset 8  Driver sleep timeout */
 	u8	reserved[244];	/* Offset 12   Reserved */
-} __attribute__((packed)) opregion_mailbox2_t;
+} __packed opregion_mailbox2_t;
 
 /* mailbox 3: power conservation */
 typedef struct {
@@ -163,7 +164,7 @@
 				 *            Size of Raw VBT data
 				 */
 	u8	reserved[58];	/* Offset 198 Reserved */
-} __attribute__((packed)) opregion_mailbox3_t;
+} __packed opregion_mailbox3_t;
 
 #define IGD_BACKLIGHT_BRIGHTNESS 0xff
 #define IGD_INITIAL_BRIGHTNESS 0x64
@@ -175,14 +176,14 @@
 /* mailbox 4: vbt */
 typedef struct {
 	u8 gvd1[6*KiB];
-} __attribute__((packed)) opregion_vbt_t;
+} __packed opregion_vbt_t;
 
 /* Mailbox 5: BIOS to Driver Notification Extension */
 typedef struct {
 	u32	phed;		/* Offset 7168 Panel Header */
 	u8	bddc[256];	/* Offset 7172 Panel EDID */
 	u8	reserved[764];	/* Offset 7428 764 bytes */
-} __attribute__((packed)) opregion_mailbox5_t;
+} __packed opregion_mailbox5_t;
 
 /* IGD OpRegion */
 typedef struct {
@@ -193,7 +194,7 @@
 	opregion_vbt_t vbt;
 	opregion_mailbox5_t	mailbox5;
 
-} __attribute__((packed)) igd_opregion_t;
+} __packed igd_opregion_t;
 
 /* Intel Video BIOS (Option ROM) */
 typedef struct {
@@ -202,7 +203,7 @@
 	u8	reserved[21];
 	u16	pcir_offset;
 	u16	vbt_offset;
-} __attribute__((packed)) optionrom_header_t;
+} __packed optionrom_header_t;
 
 #define OPROM_SIGNATURE 0xaa55
 
@@ -219,7 +220,7 @@
 	u8	codetype;
 	u8	indicator;
 	u16	reserved2;
-} __attribute__((packed)) optionrom_pcir_t;
+} __packed optionrom_pcir_t;
 
 typedef struct {
 	u8	hdr_signature[20];
@@ -243,7 +244,7 @@
 	u8	coreblock_integratedhw;
 	u8	coreblock_biosbuild[4];
 	u8	coreblock_biossignon[155];
-} __attribute__((packed)) optionrom_vbt_t;
+} __packed optionrom_vbt_t;
 
 void intel_gma_opregion_register(uintptr_t opregion);
 void intel_gma_restore_opregion(void);
diff --git a/src/drivers/intel/mipi_camera/chip.h b/src/drivers/intel/mipi_camera/chip.h
index d4b8c02..a66b8ac 100644
--- a/src/drivers/intel/mipi_camera/chip.h
+++ b/src/drivers/intel/mipi_camera/chip.h
@@ -17,6 +17,7 @@
 #define __INTEL_MIPI_CAMERA_CHIP_H__
 
 #include <stdint.h>
+#include <compiler.h>
 
 #define MAX_PWDB_ENTRIES 12
 
@@ -83,7 +84,7 @@
 	uint8_t mipi_data_format;		/* MIPI data format */
 	uint8_t silicon_version;		/* Silicon version */
 	uint8_t customer_id;			/* Customer ID */
-} __attribute__((packed));
+} __packed;
 
 struct intel_pwdb {
 	char name[32];		/* Name of the resource required by the power
@@ -92,7 +93,7 @@
 	uint32_t entry_type;	/* The type of the current power action */
 	uint32_t delay_usec;	/* The delay time after which power action is
 				performed and this is in unit of usec */
-} __attribute__((packed));
+} __packed;
 
 struct drivers_intel_mipi_camera_config {
 	struct intel_ssdb ssdb;
diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c
index a71f014..91c21fe 100644
--- a/src/drivers/intel/wifi/wifi.c
+++ b/src/drivers/intel/wifi/wifi.c
@@ -14,6 +14,7 @@
  * GNU General Public License for more details.
  */
 
+#include <compiler.h>
 #include <arch/acpi_device.h>
 #include <arch/acpigen.h>
 #include <console/console.h>
@@ -36,7 +37,7 @@
 		u16 handle;
 		u8 str;
 		char eos[2];
-	} __attribute__((packed));
+	} __packed;
 
 	struct smbios_type_intel_wifi *t =
 		(struct smbios_type_intel_wifi *)*current;
diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.h b/src/drivers/siemens/nc_fpga/nc_fpga.h
index 0a0b0c6..2cb0200 100644
--- a/src/drivers/siemens/nc_fpga/nc_fpga.h
+++ b/src/drivers/siemens/nc_fpga/nc_fpga.h
@@ -16,6 +16,8 @@
 #ifndef _SIEMENS_NC_FPGA_H_
 #define _SIEMENS_NC_FPGA_H_
 
+#include <compiler.h>
+
 #define NC_MAGIC_OFFSET			0x020
 #define  NC_FPGA_MAGIC			0x4E433746
 #define NC_CAP1_OFFSET			0x080
@@ -64,6 +66,6 @@
 	uint16_t	hystthreshold;
 	uint16_t	res9[4];
 	uint32_t	fanmon;
-} __attribute__ ((packed)) fan_ctrl_t;
+} __packed fan_ctrl_t;
 
 #endif /* _SIEMENS_NC_FPGA_H_ */
diff --git a/src/drivers/usb/ehci.h b/src/drivers/usb/ehci.h
index 25c08a0..33b7854 100644
--- a/src/drivers/usb/ehci.h
+++ b/src/drivers/usb/ehci.h
@@ -19,6 +19,8 @@
 #ifndef EHCI_H
 #define EHCI_H
 
+#include <compiler.h>
+
 /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
 
 /* Section 2.2 Host Controller Capability Registers */
@@ -52,7 +54,7 @@
 #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1))  /* true: periodic_size changes*/
 #define HCC_64BIT_ADDR(p)       ((p)&(1))       /* true: can use 64-bit addr */
 	u8		portroute[8];	 /* nibbles for routing - offset 0xC */
-} __attribute__ ((packed));
+} __packed;
 
 
 /* Section 2.3 Host Controller Operational Registers */
@@ -148,7 +150,7 @@
 #define PORT_CSC	(1<<1)		/* connect status change */
 #define PORT_CONNECT	(1<<0)		/* device connected */
 #define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
-} __attribute__ ((packed));
+} __packed;
 
 #define USBMODE		0x68		/* USB Device mode */
 #define USBMODE_SDIS	(1<<3)		/* Stream disable */
@@ -192,7 +194,7 @@
 	u32	data47;
 	u32	address;
 #define DBGP_EPADDR(dev, ep)	(((dev)<<8)|(ep))
-} __attribute__ ((packed));
+} __packed;
 
 #define USB_DEBUG_DEVNUM 127
 
diff --git a/src/drivers/usb/usb_ch9.h b/src/drivers/usb/usb_ch9.h
index 4509287..271b7d1 100644
--- a/src/drivers/usb/usb_ch9.h
+++ b/src/drivers/usb/usb_ch9.h
@@ -17,6 +17,8 @@
 #ifndef USB_CH9_H
 #define USB_CH9_H
 
+#include <compiler.h>
+
 #define USB_DIR_OUT                     0               /* to device */
 #define USB_DIR_IN                      0x80            /* to host */
 
@@ -111,7 +113,7 @@
         u16 wValue;
         u16 wIndex;
         u16 wLength;
-} __attribute__ ((packed));
+} __packed;
 
 struct usb_debug_descriptor {
         u8  bLength;