Skip to contentSkip to conversation

scsi: ufs: Fix the build for the old ARM OABI

PATCH Applied Bart Van Assche 4 participants 5 messages Aug 29, 2023 – Sep 5, 2023 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: Fix the build for the old ARM OABI

All structs and unions are word aligned when using the OABI. Mark the union in struct utp_upiu_header as packed to prevent that the compiler inserts padding bytes.

Cc Arnd Bergmann <[email protected]>
Fixes 617bfaa8dd50 ("scsi: ufs: Simplify response header parsing")
---
 include/uapi/scsi/scsi_bsg_ufs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/scsi/scsi_bsg_ufs.h +1 -1
index bf1832dc35db..b41b5ae1d515 100644
@@ -83,7 +83,7 @@ struct utp_upiu_header {
 			union {
 				__u8 tm_function;
 				__u8 query_function;
-			};
+			} __attribute__((packed));
 			__u8 response;
 			__u8 status;
 			__u8 ehs_length;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bart Van Assche

All structs and unions are word aligned when using the OABI. Mark the union in struct utp_upiu_header as packed to prevent that the compiler inserts padding bytes.

Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/

Fixes 617bfaa8dd50 ("scsi: ufs: Simplify response header parsing")
Reviewed-by on v1 1/1
#2 lore raw
In reply to Bart Van Assche
Quoted 9 lines · Bart Van Assche

All structs and unions are word aligned when using the OABI. Mark the union in struct utp_upiu_header as packed to prevent that the compiler inserts padding bytes.

Cc Arnd Bergmann<[email protected]>
Fixes 617bfaa8dd50 ("scsi: ufs: Simplify response header parsing")

Thanks for the prompt fix!

#3 lore raw
In reply to Bart Van Assche

Bart,

Quoted 3 lines

All structs and unions are word aligned when using the OABI. Mark the union in struct utp_upiu_header as packed to prevent that the compiler inserts padding bytes.

Applied to 6.6/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering