diff mbox series

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

Message ID 20230829163547.1200183-1-bvanassche@acm.org (mailing list archive)
State Accepted
Headers show
Series scsi: ufs: Fix the build for the old ARM OABI | expand

Commit Message

Bart Van Assche Aug. 29, 2023, 4:35 p.m. UTC
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>
---
 include/uapi/scsi/scsi_bsg_ufs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Aug. 29, 2023, 6:25 p.m. UTC | #1
On Tue, Aug 29, 2023, at 12:35, Bart Van Assche wrote:
> 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>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Bean Huo Aug. 29, 2023, 8:48 p.m. UTC | #2
On 29.08.23 6:35 PM, Bart Van Assche wrote:
> 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>

Thanks for the prompt fix!

Reviewed-by: Bean Huo <beanhuo@micron.com>
Martin K. Petersen Aug. 31, 2023, 1:16 a.m. UTC | #3
Bart,

> 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!
Martin K. Petersen Sept. 5, 2023, 10:18 a.m. UTC | #4
On Tue, 29 Aug 2023 09:35:42 -0700, Bart Van Assche wrote:

> 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-queue, thanks!

[1/1] scsi: ufs: Fix the build for the old ARM OABI
      https://git.kernel.org/mkp/scsi/c/d0bac0ec89d6
diff mbox series

Patch

diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h
index bf1832dc35db..b41b5ae1d515 100644
--- a/include/uapi/scsi/scsi_bsg_ufs.h
+++ b/include/uapi/scsi/scsi_bsg_ufs.h
@@ -83,7 +83,7 @@  struct utp_upiu_header {
 			union {
 				__u8 tm_function;
 				__u8 query_function;
-			};
+			} __attribute__((packed));
 			__u8 response;
 			__u8 status;
 			__u8 ehs_length;