Skip to content

Commit

Permalink
target: Define target_use_signed_kernel() / target_is_ssd_enabled() i…
Browse files Browse the repository at this point in the history
…nline

This allows the compiler to properly optimize if statements where
they are used.
  • Loading branch information
stephan-gh committed Oct 19, 2020
1 parent 4b96b59 commit 4902caa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
20 changes: 18 additions & 2 deletions include/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ unsigned target_baseband(void);
void target_serialno(unsigned char *buf);
void target_fastboot_init(void);
void target_load_ssd_keystore(void);
bool target_is_ssd_enabled(void);
void *target_mmc_device();
uint32_t is_user_force_reset(void);

Expand All @@ -81,7 +80,6 @@ void target_usb_stop(void);
uint32_t target_get_hlos_subtype(void);
void shutdown_device();
bool target_warm_boot(void);
bool target_use_signed_kernel(void);
int _emmc_recovery_init(void);
void ulpi_write(unsigned val, unsigned reg);
void target_crypto_init_params(void);
Expand All @@ -96,4 +94,22 @@ uint32_t target_get_battery_voltage();
bool target_battery_soc_ok();
bool target_battery_is_present();
uint32_t target_get_pmic();

static inline bool target_use_signed_kernel(void)
{
#if _SIGNED_KERNEL
return 1;
#else
return 0;
#endif
}

static inline bool target_is_ssd_enabled(void)
{
#ifdef SSD_ENABLE
return 1;
#else
return 0;
#endif
}
#endif
18 changes: 0 additions & 18 deletions target/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,6 @@ __WEAK int emmc_recovery_init(void)
return 0;
}

__WEAK bool target_use_signed_kernel(void)
{
#if _SIGNED_KERNEL
return 1;
#else
return 0;
#endif
}

__WEAK bool target_is_ssd_enabled(void)
{
#ifdef SSD_ENABLE
return 1;
#else
return 0;
#endif
}

__WEAK void target_load_ssd_keystore(void)
{
}
Expand Down

0 comments on commit 4902caa

Please sign in to comment.