scsi: ufs: Fix the build for the old ARM OABI
authorBart Van Assche <bvanassche@acm.org>
Tue, 29 Aug 2023 16:35:42 +0000 (09:35 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 31 Aug 2023 01:15:03 +0000 (21:15 -0400)
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 <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308251634.tuRn4OVv-lkp@intel.com/
Fixes: 617bfaa8dd50 ("scsi: ufs: Simplify response header parsing")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230829163547.1200183-1-bvanassche@acm.org
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/uapi/scsi/scsi_bsg_ufs.h

index 7c7975f9905e20bb74a396b1b34b2d7e0be17915..03f2beadf2019b61ef8abd0e9cc42a7d4c421631 100644 (file)
@@ -83,7 +83,7 @@ struct utp_upiu_header {
                        union {
                                __u8 tm_function;
                                __u8 query_function;
-                       };
+                       } __attribute__((packed));
                        __u8 response;
                        __u8 status;
                        __u8 ehs_length;