diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-07-03 10:56:39 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-07-03 10:56:39 -0700 |
commit | c3ac7aa5d47997a07570519af5aebaf94f4d5cb3 (patch) | |
tree | c652a4c1acbda638ac8cfe0dbd37ec864080a32a | |
parent | ad3f8487ff9baaeedfa71a1e216c4ac28c3316a1 (diff) | |
parent | 3b47d981337933112726a656a724b9dfd4651852 (diff) | |
download | android_vendor_qcom_opensource_dataservices-c3ac7aa5d47997a07570519af5aebaf94f4d5cb3.tar.gz android_vendor_qcom_opensource_dataservices-c3ac7aa5d47997a07570519af5aebaf94f4d5cb3.tar.bz2 android_vendor_qcom_opensource_dataservices-c3ac7aa5d47997a07570519af5aebaf94f4d5cb3.zip |
Merge "datatop: remove unused variables"
-rw-r--r-- | datatop/src/datatop_gen_poll.c | 4 | ||||
-rw-r--r-- | datatop/src/datatop_stat_poll.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/datatop/src/datatop_gen_poll.c b/datatop/src/datatop_gen_poll.c index 457cc35..c3eb09d 100644 --- a/datatop/src/datatop_gen_poll.c +++ b/datatop/src/datatop_gen_poll.c @@ -69,6 +69,10 @@ static int get_number_of_values(struct dtop_data_point_gatherer *dpg) read = dt_read_file(dpg->file, &data, DTOP_GEN_SIZE); line_len = dt_read_line(line, DTOP_GEN_LINE, data, DTOP_GEN_SIZE, 0); + if (read == 0) { + return 0; + } + if (line_len < 1) { dt_free(&data); return 0; diff --git a/datatop/src/datatop_stat_poll.c b/datatop/src/datatop_stat_poll.c index 3eadaeb..88320b5 100644 --- a/datatop/src/datatop_stat_poll.c +++ b/datatop/src/datatop_stat_poll.c @@ -219,7 +219,7 @@ static void construct_stat_file_dpg(struct dtop_data_point */ int dtop_stat_search(struct dtop_stat_vars *storage) { - int i, k, n, sum; + int i, n, sum; char *data; int *line_len = malloc(sizeof(int) * storage->line_count); int read; @@ -297,7 +297,6 @@ int dtop_stat_search(struct dtop_stat_vars *storage) count++; } } - k = 0; /* Calls dpg constructor, dpg will point to the dp struct */ construct_stat_file_dpg(data_points, storage, dp_count); |