Merge "Only Win32 doesn't have writev."
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 4a6b702..06497c2 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -389,7 +389,6 @@
if (!strcmp(name, ".") || !strcmp(name, ".."))
continue;
- char buf[20];
// Look for "type" file in each subdirectory
path.clear();
path.appendFormat("%s/%s/type", POWER_SUPPLY_SYSFS_PATH, name);
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 30a4b42..b34583d 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -64,7 +64,6 @@
#define MAX_EPOLL_EVENTS 40
static int uevent_fd;
static int wakealarm_fd;
-static int binder_fd;
// -1 for no epoll timeout
static int awake_poll_interval = -1;
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index 394feb8..291cb6c 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -350,7 +350,6 @@
static void update_screen_state(struct charger *charger, int64_t now)
{
struct animation *batt_anim = charger->batt_anim;
- int cur_frame;
int disp_time;
if (!batt_anim->run || now < charger->next_screen_transition)
@@ -393,7 +392,6 @@
/* animation starting, set up the animation */
if (batt_anim->cur_frame == 0) {
int batt_cap;
- int ret;
LOGV("[%" PRId64 "] animation starting\n", now);
batt_cap = get_battery_capacity();
@@ -517,7 +515,6 @@
static void process_key(struct charger *charger, int code, int64_t now)
{
struct key_state *key = &charger->keys[code];
- int64_t next_key_check;
if (code == KEY_POWER) {
if (key->down) {
@@ -590,7 +587,6 @@
{
struct charger *charger = &charger_state;
int64_t now = curr_time_ms();
- int ret;
handle_input_state(charger, now);
handle_power_supply_state(charger, now);
@@ -625,8 +621,6 @@
int64_t now = curr_time_ms();
int64_t next_event = INT64_MAX;
int64_t timeout;
- struct input_event ev;
- int ret;
LOGV("[%" PRId64 "] next screen: %" PRId64 " next key: %" PRId64 " next pwr: %" PRId64 "\n", now,
charger->next_screen_transition, charger->next_key_check,
diff --git a/init/builtins.c b/init/builtins.c
index 7f4daa7..5d2a517 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -501,7 +501,6 @@
int ret = -1;
int child_ret = -1;
int status;
- const char *prop;
struct fstab *fstab;
if (nargs != 2) {
diff --git a/init/devices.c b/init/devices.c
index a95111a..dde43df 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -191,7 +191,6 @@
static mode_t get_device_perm(const char *path, const char **links,
unsigned *uid, unsigned *gid)
{
- mode_t perm;
struct listnode *node;
struct perm_node *perm_node;
struct perms_ *dp;
@@ -497,15 +496,10 @@
struct platform_node *pdev;
char *slash;
const char *type;
- int width;
char buf[256];
char link_path[256];
- int fd;
int link_num = 0;
- int ret;
char *p;
- unsigned int size;
- struct stat info;
pdev = find_platform_device(uevent->path);
if (pdev) {
@@ -926,7 +920,6 @@
static void handle_firmware_event(struct uevent *uevent)
{
pid_t pid;
- int ret;
if(strcmp(uevent->subsystem, "firmware"))
return;
@@ -1045,15 +1038,18 @@
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
fcntl(device_fd, F_SETFL, O_NONBLOCK);
- if (stat(coldboot_done, &info) < 0) {
+ if (stat(COLDBOOT_DONE, &info) < 0) {
t0 = get_usecs();
coldboot("/sys/class");
coldboot("/sys/block");
coldboot("/sys/devices");
t1 = get_usecs();
- fd = open(coldboot_done, O_WRONLY|O_CREAT, 0000);
+ fd = open(COLDBOOT_DONE, O_WRONLY|O_CREAT, 0000);
close(fd);
log_event_print("coldboot %ld uS\n", ((long) (t1 - t0)));
+ // t0 & t1 are unused if the log isn't doing anything.
+ (void)t0;
+ (void)t1;
} else {
log_event_print("skipping coldboot, already done\n");
}
diff --git a/init/init.c b/init/init.c
index 99474e6..2b82937 100644
--- a/init/init.c
+++ b/init/init.c
@@ -76,7 +76,6 @@
static struct action *cur_action = NULL;
static struct command *cur_command = NULL;
-static struct listnode *command_queue = NULL;
void notify_service_state(const char *name, const char *state)
{
@@ -170,7 +169,6 @@
struct stat s;
pid_t pid;
int needs_console;
- int n;
char *scon = NULL;
int rc;
@@ -578,10 +576,10 @@
static int wait_for_coldboot_done_action(int nargs, char **args)
{
int ret;
- INFO("wait for %s\n", coldboot_done);
- ret = wait_for_file(coldboot_done, COMMAND_RETRY_TIMEOUT);
+ INFO("wait for %s\n", COLDBOOT_DONE);
+ ret = wait_for_file(COLDBOOT_DONE, COMMAND_RETRY_TIMEOUT);
if (ret)
- ERROR("Timed out waiting for %s\n", coldboot_done);
+ ERROR("Timed out waiting for %s\n", COLDBOOT_DONE);
return ret;
}
@@ -1003,9 +1001,6 @@
{
int fd_count = 0;
struct pollfd ufds[4];
- char *tmpdev;
- char* debuggable;
- char tmp[32];
int property_set_fd_init = 0;
int signal_fd_init = 0;
int keychord_fd_init = 0;
diff --git a/init/init_parser.c b/init/init_parser.c
index 6466db2..2b4db8e 100644
--- a/init/init_parser.c
+++ b/init/init_parser.c
@@ -187,19 +187,14 @@
int expand_props(char *dst, const char *src, int dst_size)
{
- int cnt = 0;
char *dst_ptr = dst;
const char *src_ptr = src;
- int src_len;
- int idx = 0;
int ret = 0;
int left = dst_size - 1;
if (!src || !dst || dst_size == 0)
return -1;
- src_len = strlen(src);
-
/* - variables can either be $x.y or ${x.y}, in case they are only part
* of the string.
* - will accept $$ as a literal $.
@@ -847,7 +842,6 @@
{
struct command *cmd;
struct action *act = state->context;
- int (*func)(int nargs, char **args);
int kw, n;
if (nargs == 0) {
diff --git a/init/property_service.c b/init/property_service.c
index 44658c5..1f98e13 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -63,7 +63,6 @@
static int init_workspace(workspace *w, size_t size)
{
- void *data;
int fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW);
if (fd < 0)
return -1;
@@ -142,9 +141,6 @@
*/
static int check_perms(const char *name, char *sctx)
{
- int i;
- unsigned int app_id;
-
if(!strncmp(name, "ro.", 3))
name +=3;
@@ -261,7 +257,6 @@
prop_msg msg;
int s;
int r;
- int res;
struct ucred cr;
struct sockaddr_un addr;
socklen_t addr_size = sizeof(addr);
diff --git a/init/util.h b/init/util.h
index 04b8129..4cfe99d 100644
--- a/init/util.h
+++ b/init/util.h
@@ -22,7 +22,7 @@
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-static const char *coldboot_done = "/dev/.coldboot_done";
+#define COLDBOOT_DONE "/dev/.coldboot_done"
int mtd_name_to_number(const char *name);
int create_socket(const char *name, int type, mode_t perm,
diff --git a/libion/ion.c b/libion/ion.c
index 80bdc2a..a79525d 100644
--- a/libion/ion.c
+++ b/libion/ion.c
@@ -117,7 +117,6 @@
int ion_share(int fd, ion_user_handle_t handle, int *share_fd)
{
- int map_fd;
int ret;
struct ion_fd_data data = {
.handle = handle,
diff --git a/libion/ion_test.c b/libion/ion_test.c
index 8872282..b7d5583 100644
--- a/libion/ion_test.c
+++ b/libion/ion_test.c
@@ -164,8 +164,9 @@
printf("master->master? [%10s]\n", ptr);
if (recvmsg(sd[0], &msg, 0) < 0)
perror("master recv 1");
+ close(fd);
+ _exit(0);
} else {
- struct msghdr msg;
struct cmsghdr *cmsg;
char* ptr;
int fd, recv_fd;
@@ -205,6 +206,7 @@
strcpy(ptr, "child");
printf("child sending msg 2\n");
sendmsg(sd[1], &child_msg, 0);
+ close(fd);
}
}
diff --git a/libsuspend/autosuspend_autosleep.c b/libsuspend/autosuspend_autosleep.c
index 5451615..0d31e74 100644
--- a/libsuspend/autosuspend_autosleep.c
+++ b/libsuspend/autosuspend_autosleep.c
@@ -84,7 +84,6 @@
struct autosuspend_ops *autosuspend_autosleep_init(void)
{
- int ret;
char buf[80];
autosleep_fd = open(SYS_POWER_AUTOSLEEP, O_WRONLY);
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index a534a24..7bbc811 100644
--- a/lmkd/lmkd.c
+++ b/lmkd/lmkd.c
@@ -607,7 +607,6 @@
static int find_and_kill_process(int other_free, int other_file, bool first)
{
int i;
- int r;
int min_score_adj = OOM_ADJUST_MAX + 1;
int minfree = 0;
int killed_size = 0;
@@ -643,7 +642,6 @@
}
static void mp_event(uint32_t events __unused) {
- int i;
int ret;
unsigned long long evcount;
struct sysmeminfo mi;