include: sbi: Don't pack struct sbi_platform and sbi_platform_operations
authorAnup Patel <anup.patel@wdc.com>
Mon, 11 Jan 2021 11:45:00 +0000 (17:15 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 15 Jan 2021 05:10:33 +0000 (10:40 +0530)
We don't need to pack struct sbi_platform and sbi_platform_operations
because GCC ensures member offsets match member data type irrespective
to the target system (RV32 or RV64). This also allows GCC to generate
more optimized instruction sequence when accessing members of struct
sbi_platform and struct sbi_platform_operations.

Reported-by: Paul Campbell <taniwha@gmail.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
include/sbi/sbi_platform.h

index c2526286eaf8df32d52b7f2e19bb1a5ac75e0ec9..cc7e3ff991897d39bc4c153d3c21c91414c69a4f 100644 (file)
@@ -152,7 +152,7 @@ struct sbi_platform_operations {
                                   const struct sbi_trap_regs *regs,
                                   unsigned long *out_value,
                                   struct sbi_trap_info *out_trap);
-} __packed;
+};
 
 /** Platform default per-HART stack size for exception/interrupt handling */
 #define SBI_PLATFORM_DEFAULT_HART_STACK_SIZE   8192
@@ -199,7 +199,7 @@ struct sbi_platform {
         * 2. HART id < SBI_HARTMASK_MAX_BITS
         */
        const u32 *hart_index2id;
-} __packed;
+};
 
 /** Get pointer to sbi_platform for sbi_scratch pointer */
 #define sbi_platform_ptr(__s) \