Skip to contentSkip to conversation

Remove PACKED macro and use __attribute__((packed)) directly

PATCH In review WANG Chao 3 participants 4 messages Sep 5, 2013 – Oct 16, 2013

Subsystems (2)
lore
Share & tools
lore

WANG Chao

author
#0 lore raw

PATCH 1/1 Remove PACKED macro and use __attribute__((packed)) directly

People are not always aware of PACKED macro and tend to __attribute__((packed)) more directly. So let's remove PACKED to unify things.

---
 include/x86/x86-linux.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/x86/x86-linux.h +2 -4
index 0949dc2..c41e5f2 100644
@@ -12,8 +12,6 @@
 
 #ifndef ASSEMBLY
 
-#define PACKED __attribute__((packed))
-
 #ifndef E820_RAM
 struct e820entry {
 	uint64_t addr;	/* start of memory segment */
@@ -23,7 +21,7 @@ struct e820entry {
 #define E820_RESERVED	2
 #define E820_ACPI	3 /* usable as RAM once ACPI tables have been read */
 #define E820_NVS	4
-} PACKED;
+} __attribute__((packed));
 #endif
 
 /* FIXME expand on drive_info_)struct... */
@@ -255,7 +253,7 @@ struct x86_linux_header {
 	uint64_t pref_address;			/* 0x258 */
 	uint32_t init_size;			/* 0x260 */
 	uint32_t handover_offset;		/* 0x264 */
-} PACKED;
+} __attribute__((packed));
 
 #endif /* ASSEMBLY */
 
Signature · 7 lines
1.8.3.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · WANG Chao

People are not always aware of PACKED macro and tend to __attribute__((packed)) more directly. So let's remove PACKED to unify things.

Thanks, this looks good to me.

I suggest re-posting with Andre Morton CCed to see if he will pick it up.

Quoted 44 lines
---
 include/x86/x86-linux.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/x86/x86-linux.h +2 -4
index 0949dc2..c41e5f2 100644
@@ -12,8 +12,6 @@
 
 #ifndef ASSEMBLY
 
-#define PACKED __attribute__((packed))
-
 #ifndef E820_RAM
 struct e820entry {
 	uint64_t addr;	/* start of memory segment */
@@ -23,7 +21,7 @@ struct e820entry {
 #define E820_RESERVED	2
 #define E820_ACPI	3 /* usable as RAM once ACPI tables have been read */
 #define E820_NVS	4
-} PACKED;
+} __attribute__((packed));
 #endif
 
 /* FIXME expand on drive_info_)struct... */
@@ -255,7 +253,7 @@ struct x86_linux_header {
 	uint64_t pref_address;			/* 0x258 */
 	uint32_t init_size;			/* 0x260 */
 	uint32_t handover_offset;		/* 0x264 */
-} PACKED;
+} __attribute__((packed));
 
 #endif /* ASSEMBLY */
 
Signature · 7 lines
1.8.3.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw

Hello simon,

Quoted 5 lines · Simon Horman
Quoted 4 lines · WANG Chao

People are not always aware of PACKED macro and tend to __attribute__((packed)) more directly. So let's remove PACKED to unify things.

Quoted 8 lines
Quoted 1 line

Thanks, this looks good to me.

I suggest re-posting with Andre Morton CCed to see if he will pick it up.

You should take this because this is a change in kexec-tools, not in kernel source......:)

Quoted 46 lines
Quoted 45 lines
---
 include/x86/x86-linux.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/x86/x86-linux.h +2 -4
index 0949dc2..c41e5f2 100644
@@ -12,8 +12,6 @@
 
 #ifndef ASSEMBLY
 
-#define PACKED __attribute__((packed))
-
 #ifndef E820_RAM
 struct e820entry {
 	uint64_t addr;	/* start of memory segment */
@@ -23,7 +21,7 @@ struct e820entry {
 #define E820_RESERVED	2
 #define E820_ACPI	3 /* usable as RAM once ACPI tables have been read */
 #define E820_NVS	4
-} PACKED;
+} __attribute__((packed));
 #endif
 
 /* FIXME expand on drive_info_)struct... */
@@ -255,7 +253,7 @@ struct x86_linux_header {
 	uint64_t pref_address;			/* 0x258 */
 	uint32_t init_size;			/* 0x260 */
 	uint32_t handover_offset;		/* 0x264 */
-} PACKED;
+} __attribute__((packed));
 
 #endif /* ASSEMBLY */
 
Signature · 7 lines
1.8.3.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Signature · 7 lines
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
Quoted 12 lines · Zhang Yanfei

Hello simon,

Quoted 9 lines · Simon Horman
Quoted 5 lines · WANG Chao

People are not always aware of PACKED macro and tend to __attribute__((packed)) more directly. So let's remove PACKED to unify things.

Thanks, this looks good to me.

Quoted 7 lines
Quoted 4 lines

I suggest re-posting with Andre Morton CCed to see if he will pick it up.

You should take this because this is a change in kexec-tools, not in kernel source......:)

Oops. Thanks, I will take it.

Quoted 41 lines
Quoted 41 lines
Quoted 41 lines

---
 include/x86/x86-linux.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/x86/x86-linux.h +2 -4
index 0949dc2..c41e5f2 100644
@@ -12,8 +12,6 @@
 
 #ifndef ASSEMBLY
 
-#define PACKED __attribute__((packed))
-
 #ifndef E820_RAM
 struct e820entry {
 	uint64_t addr;	/* start of memory segment */
@@ -23,7 +21,7 @@ struct e820entry {
 #define E820_RESERVED	2
 #define E820_ACPI	3 /* usable as RAM once ACPI tables have been read */
 #define E820_NVS	4
-} PACKED;
+} __attribute__((packed));
 #endif
 
 /* FIXME expand on drive_info_)struct... */
@@ -255,7 +253,7 @@ struct x86_linux_header {
 	uint64_t pref_address;			/* 0x258 */
 	uint32_t init_size;			/* 0x260 */
 	uint32_t handover_offset;		/* 0x264 */
-} PACKED;
+} __attribute__((packed));
 
 #endif /* ASSEMBLY */
 
Signature · 1 line
1.8.3.1
Quoted 17 lines
Quoted 6 lines
Quoted 5 lines

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Signature · 7 lines
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec