Skip to contentSkip to conversation

arm: omap3: Make try_unlock_memory() static

PATCH New Adam Ford 3 participants 4 messages Mar 7, 2021 – Mar 16, 2021

Subsystems (3)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 arm: omap3: Make try_unlock_memory() static

try_unlock_memory() is only used in one file, so make it static in that file and remove it from the sys_proto header file. This may help with some further optimization in the future.

arch/arm/include/asm/arch-omap3/sys_proto.h +0 -1
index 32ac033515..656f848a73 100644
@@ -60,7 +60,6 @@ u32 is_running_in_sram(void);
 u32 is_running_in_flash(void);
 u32 get_device_type(void);
 void secureworld_exit(void);
-void try_unlock_memory(void);
 u32 get_boot_type(void);
 void invalidate_dcache(u32);
 u32 wait_on_value(u32, u32, void *, u32);
arch/arm/mach-omap2/omap3/board.c +1 -1
index 029bd54595..c621177580 100644
@@ -145,7 +145,7 @@ void secureworld_exit(void)
  * Description: If chip is GP/EMU(special) type, unlock the SRAM for
  *              general use.
  *****************************************************************************/
-void try_unlock_memory(void)
+static void try_unlock_memory(void)
 {
 	int mode;
 	int in_sdram = is_running_in_sdram();
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 arm: omap3: Make try_unlock_memory() static

Quoted 5 lines · Adam Ford

try_unlock_memory() is only used in one file, so make it static in that file and remove it from the sys_proto header file. This may help with some further optimization in the future.

one of omap3 board is failing to build. Can you take a look?

https://source.denx.de/u-boot/custodians/u-boot-ti/-/jobs/237886

Thanks and regards,
Lokesh

Quoted 27 lines
arch/arm/include/asm/arch-omap3/sys_proto.h +0 -1
index 32ac033515..656f848a73 100644
@@ -60,7 +60,6 @@ u32 is_running_in_sram(void);
 u32 is_running_in_flash(void);
 u32 get_device_type(void);
 void secureworld_exit(void);
-void try_unlock_memory(void);
 u32 get_boot_type(void);
 void invalidate_dcache(u32);
 u32 wait_on_value(u32, u32, void *, u32);
arch/arm/mach-omap2/omap3/board.c +1 -1
index 029bd54595..c621177580 100644
@@ -145,7 +145,7 @@ void secureworld_exit(void)
  * Description: If chip is GP/EMU(special) type, unlock the SRAM for
  *              general use.
  *****************************************************************************/
-void try_unlock_memory(void)
+static void try_unlock_memory(void)
 {
 	int mode;
 	int in_sdram = is_running_in_sdram();
author
#2 lore raw

PATCH 1/1 arm: omap3: Make try_unlock_memory() static

Quoted 8 lines · Lokesh Vutla
Quoted 4 lines · Adam Ford

try_unlock_memory() is only used in one file, so make it static in that file and remove it from the sys_proto header file. This may help with some further optimization in the future.

Quoted 6 lines
Quoted 1 line

one of omap3 board is failing to build. Can you take a look?

https://source.denx.de/u-boot/custodians/u-boot-ti/-/jobs/237886

Question on preference...Would you prefer I move the unused function into the #ifdef area, or should I just mark the function as
__maybe_unused? I am not a fan of #ifdef, but I can move the
function there that is your preference.

adam

Quoted 30 lines

Thanks and regards,
Lokesh

Quoted 27 lines
arch/arm/include/asm/arch-omap3/sys_proto.h +0 -1
index 32ac033515..656f848a73 100644
@@ -60,7 +60,6 @@ u32 is_running_in_sram(void);
 u32 is_running_in_flash(void);
 u32 get_device_type(void);
 void secureworld_exit(void);
-void try_unlock_memory(void);
 u32 get_boot_type(void);
 void invalidate_dcache(u32);
 u32 wait_on_value(u32, u32, void *, u32);
arch/arm/mach-omap2/omap3/board.c +1 -1
index 029bd54595..c621177580 100644
@@ -145,7 +145,7 @@ void secureworld_exit(void)
  * Description: If chip is GP/EMU(special) type, unlock the SRAM for
  *              general use.
  *****************************************************************************/
-void try_unlock_memory(void)
+static void try_unlock_memory(void)
 {
      int mode;
      int in_sdram = is_running_in_sdram();
#3 lore raw

PATCH 1/1 arm: omap3: Make try_unlock_memory() static

Quoted 13 lines · Adam Ford
Quoted 12 lines · Lokesh Vutla
Quoted 5 lines · Adam Ford

try_unlock_memory() is only used in one file, so make it static in that file and remove it from the sys_proto header file. This may help with some further optimization in the future.

one of omap3 board is failing to build. Can you take a look?

Quoted 7 lines
Quoted 2 lines

https://source.denx.de/u-boot/custodians/u-boot-ti/-/jobs/237886

Question on preference...Would you prefer I move the unused function into the #ifdef area, or should I just mark the function as
__maybe_unused? I am not a fan of #ifdef, but I can move the
function there that is your preference.

If there's already an #ifdef we should restructure the code to live there, yes.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210316/ce9f2993/attachment.sig>