lmkd: Remove unused variables and fix type mismatches
Fix compilation warnings by removing unused variables and add typecasting whenever mixed type comparisons are performed. Bug: 147315292 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Merged-In: I7f0839d803a6bf6532f077208ce54aba761dc9fe Change-Id: I7f0839d803a6bf6532f077208ce54aba761dc9fe
This commit is contained in:
parent
c7e51b7b2a
commit
dd7ec447ab
|
|
@ -55,7 +55,7 @@ int lmkd_unregister_proc(int sock, struct lmk_procremove *params) {
|
||||||
|
|
||||||
enum update_props_result lmkd_update_props(int sock) {
|
enum update_props_result lmkd_update_props(int sock) {
|
||||||
LMKD_CTRL_PACKET packet;
|
LMKD_CTRL_PACKET packet;
|
||||||
size_t size;
|
int size;
|
||||||
|
|
||||||
size = lmkd_pack_set_update_props(packet);
|
size = lmkd_pack_set_update_props(packet);
|
||||||
if (TEMP_FAILURE_RETRY(write(sock, packet, size)) < 0) {
|
if (TEMP_FAILURE_RETRY(write(sock, packet, size)) < 0) {
|
||||||
|
|
|
||||||
11
lmkd.cpp
11
lmkd.cpp
|
|
@ -2124,7 +2124,6 @@ static int find_and_kill_process(int min_score_adj, int kill_reason, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t get_memory_usage(struct reread_data *file_data) {
|
static int64_t get_memory_usage(struct reread_data *file_data) {
|
||||||
int ret;
|
|
||||||
int64_t mem_usage;
|
int64_t mem_usage;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
|
|
@ -2279,8 +2278,8 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
}
|
}
|
||||||
|
|
||||||
bool kill_pending = is_kill_pending();
|
bool kill_pending = is_kill_pending();
|
||||||
if (kill_pending &&
|
if (kill_pending && (kill_timeout_ms == 0 ||
|
||||||
(kill_timeout_ms == 0 || get_time_diff_ms(&last_kill_tm, &curr_tm) < kill_timeout_ms)) {
|
get_time_diff_ms(&last_kill_tm, &curr_tm) < static_cast<long>(kill_timeout_ms))) {
|
||||||
/* Skip while still killing a process */
|
/* Skip while still killing a process */
|
||||||
goto no_kill;
|
goto no_kill;
|
||||||
}
|
}
|
||||||
|
|
@ -2457,7 +2456,6 @@ no_kill:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mp_event_common(int data, uint32_t events, struct polling_params *poll_params) {
|
static void mp_event_common(int data, uint32_t events, struct polling_params *poll_params) {
|
||||||
int ret;
|
|
||||||
unsigned long long evcount;
|
unsigned long long evcount;
|
||||||
int64_t mem_usage, memsw_usage;
|
int64_t mem_usage, memsw_usage;
|
||||||
int64_t mem_pressure;
|
int64_t mem_pressure;
|
||||||
|
|
@ -2512,7 +2510,8 @@ static void mp_event_common(int data, uint32_t events, struct polling_params *po
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kill_timeout_ms && get_time_diff_ms(&last_kill_tm, &curr_tm) < kill_timeout_ms) {
|
if (kill_timeout_ms &&
|
||||||
|
get_time_diff_ms(&last_kill_tm, &curr_tm) < static_cast<long>(kill_timeout_ms)) {
|
||||||
/*
|
/*
|
||||||
* If we're within the no-kill timeout, see if there's pending reclaim work
|
* If we're within the no-kill timeout, see if there's pending reclaim work
|
||||||
* from the last killed process. If so, skip killing for now.
|
* from the last killed process. If so, skip killing for now.
|
||||||
|
|
@ -3138,8 +3137,6 @@ static void mainloop(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int issue_reinit() {
|
int issue_reinit() {
|
||||||
LMKD_CTRL_PACKET packet;
|
|
||||||
size_t size;
|
|
||||||
int sock;
|
int sock;
|
||||||
|
|
||||||
sock = lmkd_connect();
|
sock = lmkd_connect();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue