diff --git a/ibmvstgt/src/srpnew.h b/ibmvstgt/src/srpnew.h index d2809f6ed..284dce982 100644 --- a/ibmvstgt/src/srpnew.h +++ b/ibmvstgt/src/srpnew.h @@ -115,7 +115,7 @@ struct srp_indirect_buf { struct srp_direct_buf table_desc; __be32 len; struct srp_direct_buf desc_list[0]; -} __attribute__((packed)); +} __packed; enum { SRP_MULTICHAN_SINGLE = 0, @@ -150,7 +150,7 @@ struct srp_login_rsp { __be16 buf_fmt; u8 rsp_flags; u8 reserved2[25]; -} __attribute__((packed)); +} __packed; struct srp_login_rej { u8 opcode; @@ -186,7 +186,7 @@ struct srp_tsk_mgmt { u8 reserved1[6]; u64 tag; u8 reserved2[4]; - __be64 lun __attribute__((packed)); + __be64 lun __packed; u8 reserved3[2]; u8 tsk_mgmt_func; u8 reserved4; @@ -207,7 +207,7 @@ struct srp_cmd { u8 data_in_desc_cnt; u64 tag; u8 reserved2[4]; - __be64 lun __attribute__((packed)); + __be64 lun __packed; u8 reserved3; u8 task_attr; u8 reserved4; @@ -244,6 +244,6 @@ struct srp_rsp { __be32 sense_data_len; __be32 resp_data_len; u8 data[0]; -} __attribute__((packed)); +} __packed; #endif /* SCSI_SRP_H */ diff --git a/iscsi-scst/kernel/iscsi_hdr.h b/iscsi-scst/kernel/iscsi_hdr.h index 821d63d15..2402ebbbe 100644 --- a/iscsi-scst/kernel/iscsi_hdr.h +++ b/iscsi-scst/kernel/iscsi_hdr.h @@ -23,8 +23,8 @@ #define ISCSI_VERSION 0 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) -#define __packed __attribute__ ((packed)) +#ifndef __packed +#error The macro __packed has not been defined. #endif /* iSCSI command PDU header. See also section 10.3 in RFC 3720. */ diff --git a/qla2x00t/qla2x00-target/qla2x00t.h b/qla2x00t/qla2x00-target/qla2x00t.h index f18938dd1..3b34f0509 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.h +++ b/qla2x00t/qla2x00-target/qla2x00t.h @@ -219,7 +219,7 @@ struct q2t_cmd { union { atio7_entry_t atio7; atio_entry_t atio2x; - } __attribute__((packed)) atio; + } __packed atio; }; struct q2t_sess_work_param { @@ -247,7 +247,7 @@ struct q2t_mgmt_cmd { notify_entry_t notify_entry; notify24xx_entry_t notify_entry24; abts24_recv_entry_t abts; - } __attribute__((packed)) orig_iocb; + } __packed orig_iocb; }; struct q2t_prm { @@ -271,7 +271,7 @@ struct srr_imm { union { notify_entry_t notify_entry; notify24xx_entry_t notify_entry24; - } __attribute__((packed)) imm; + } __packed imm; }; struct srr_ctio { diff --git a/scripts/generate-kernel-with-srp-patches b/scripts/generate-kernel-with-srp-patches index 7bbb6918a..7620e115c 100755 --- a/scripts/generate-kernel-with-srp-patches +++ b/scripts/generate-kernel-with-srp-patches @@ -633,7 +633,7 @@ index ad178fa..1ae84db 100644 +++ b/include/scsi/srp.h @@ -239,4 +239,42 @@ struct srp_rsp { u8 data[0]; - } __attribute__((packed)); + } __packed; +struct srp_cred_req { + u8 opcode; @@ -665,7 +665,7 @@ index ad178fa..1ae84db 100644 + __be32 sense_data_len; + u32 reserved3; + u8 sense_data[0]; -+} __attribute__((packed)); ++} __packed; + +struct srp_aer_rsp { + u8 opcode; diff --git a/scst/include/scst.h b/scst/include/scst.h index 5e527b757..2c9d59ca5 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -60,6 +60,10 @@ typedef _Bool bool; #define false 0 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) +#define __packed __attribute__((packed)) +#endif + #ifdef INSIDE_KERNEL_TREE #include #else