diff --git a/power-660.c b/power-660.c index c529d15..627d15b 100644 --- a/power-660.c +++ b/power-660.c @@ -57,17 +57,16 @@ static int video_encode_hint_sent; static void process_video_encode_hint(void* metadata); /** - * If target is SDM630/SDM455: - * return true - * else: - * return false + * Returns true if the target is SDM630/SDM455. */ static bool is_target_SDM630(void) { - static bool is_SDM630 = false; + static int is_SDM630 = -1; int soc_id; + if (is_SDM630 >= 0) return is_SDM630; + soc_id = get_soc_id(); - if (soc_id == 318 || soc_id == 327 || soc_id == 385) is_SDM630 = true; + is_SDM630 = soc_id == 318 || soc_id == 327 || soc_id == 385; return is_SDM630; } diff --git a/power-8937.c b/power-8937.c index ea9f43a..f02cfb2 100644 --- a/power-8937.c +++ b/power-8937.c @@ -56,17 +56,16 @@ static int video_encode_hint_sent; static void process_video_encode_hint(void* metadata); /** - * If target is SDM439/429: - * return true - * else: - * return false + * Returns true if the target is SDM439/SDM429. */ static bool is_target_SDM439(void) { - static bool is_SDM439 = false; + static int is_SDM439 = -1; int soc_id; + if (is_SDM439 >= 0) return is_SDM439; + soc_id = get_soc_id(); - if (soc_id == 353 || soc_id == 363 || soc_id == 354 || soc_id == 364) is_SDM439 = true; + is_SDM439 = soc_id == 353 || soc_id == 363 || soc_id == 354 || soc_id == 364; return is_SDM439; } diff --git a/power-8953.c b/power-8953.c index b2d7d12..f7f785a 100644 --- a/power-8953.c +++ b/power-8953.c @@ -57,17 +57,16 @@ static int video_encode_hint_sent; static void process_video_encode_hint(void* metadata); /** - * If target is SDM632: - * return true - * else: - * return false + * Returns true if the target is SDM632. */ static bool is_target_SDM632(void) { - static bool is_SDM632 = false; + static int is_SDM632 = -1; int soc_id; + if (is_SDM632 >= 0) return is_SDM632; + soc_id = get_soc_id(); - if (soc_id == 349 || soc_id == 350) is_SDM632 = true; + is_SDM632 = soc_id == 349 || soc_id == 350; return is_SDM632; }