Unsigned long should not be used as per coding guidelines
authorDeepika Bhavnani <[email protected]>
Tue, 3 Sep 2019 18:51:09 +0000 (21:51 +0300)
committerDeepika Bhavnani <[email protected]>
Fri, 13 Sep 2019 20:51:02 +0000 (23:51 +0300)
We should either change them to `unsigned int` or `unsigned long long`
when the size of the variable is the same in AArch64 and AArch32 or
to `u_register_t` if it is supposed to be 32 bit wide in AArch32
and 64 bit wide in AArch64.

Signed-off-by: Deepika Bhavnani <[email protected]>
Change-Id: I80e2a6edb33248ee88be395829abbd4c36c89abe

bl1/aarch64/bl1_arch_setup.c
bl1/bl1_fwu.c
bl1/bl1_main.c

index 624bd80f2413736f003917dd525826b3820ed3a7..0a1cb304ac766a33ddd07dd011b4fcba43a3c544 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -23,7 +23,7 @@ void bl1_arch_setup(void)
  ******************************************************************************/
 void bl1_arch_next_el_setup(void)
 {
-       unsigned long next_sctlr;
+       u_register_t next_sctlr;
 
        /* Use the same endianness than the current BL */
        next_sctlr = (read_sctlr_el3() & SCTLR_EE_BIT);
index d222b9c525cbb0571818ae946953b0b44856e57e..48f08d2ca84b9f69351889d31c18d439f810b2f9 100644 (file)
@@ -483,7 +483,7 @@ static int bl1_fwu_image_auth(unsigned int image_id,
         * Flush image_info to memory so that other
         * secure world images can see changes.
         */
-       flush_dcache_range((unsigned long)&image_desc->image_info,
+       flush_dcache_range((uintptr_t)&image_desc->image_info,
                sizeof(image_info_t));
 
        INFO("BL1-FWU: Authentication was successful\n");
index d44b46dc96edf3ca472fe09cd96e2eef2e6f4798..b882a07e5cfe47c97c2ffcb1e1d23cf723ea5d78 100644 (file)
@@ -48,7 +48,7 @@ void bl1_calc_bl2_mem_layout(const meminfo_t *bl1_mem_layout,
        bl2_mem_layout->total_base = bl1_mem_layout->total_base;
        bl2_mem_layout->total_size = BL1_RW_BASE - bl1_mem_layout->total_base;
 
-       flush_dcache_range((unsigned long)bl2_mem_layout, sizeof(meminfo_t));
+       flush_dcache_range((uintptr_t)bl2_mem_layout, sizeof(meminfo_t));
 }
 
 /*******************************************************************************