diff options
author | Andreas Gampe <agampe@google.com> | 2014-11-25 20:03:44 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-25 20:03:44 +0000 |
commit | da8edff7eddbfad5c7a3527080d62ff18ccccfae (patch) | |
tree | 7d5ef772675d4170f115e573222bf4579850e5ed /init | |
parent | 601b627905a541f70ec55ae8a9d9477288d1ef8d (diff) | |
parent | 45f2b924b653c485b18204ae84747000c02ddcf6 (diff) | |
download | system_core-da8edff7eddbfad5c7a3527080d62ff18ccccfae.zip system_core-da8edff7eddbfad5c7a3527080d62ff18ccccfae.tar.gz system_core-da8edff7eddbfad5c7a3527080d62ff18ccccfae.tar.bz2 |
am 45f2b924: am 705accc2: Merge "Init: Remove unused variables"
* commit '45f2b924b653c485b18204ae84747000c02ddcf6':
Init: Remove unused variables
Diffstat (limited to 'init')
-rw-r--r-- | init/builtins.c | 1 | ||||
-rw-r--r-- | init/devices.c | 14 | ||||
-rw-r--r-- | init/init.c | 11 | ||||
-rw-r--r-- | init/init_parser.c | 6 | ||||
-rw-r--r-- | init/property_service.c | 5 | ||||
-rw-r--r-- | init/util.h | 2 |
6 files changed, 9 insertions, 30 deletions
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 do_mount_all(int nargs, char **args) 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 bool perm_path_matches(const char *path, struct perms_ *dp) 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 @@ static char **get_block_device_symlinks(struct uevent *uevent) 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 @@ root_free_out: static void handle_firmware_event(struct uevent *uevent) { pid_t pid; - int ret; if(strcmp(uevent->subsystem, "firmware")) return; @@ -1045,15 +1038,18 @@ void device_init(void) 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 9d7bf27..269c11b 100644 --- a/init/init.c +++ b/init/init.c @@ -76,7 +76,6 @@ static char qemu[32]; 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 @@ void service_start(struct service *svc, const char *dynamic_args) struct stat s; pid_t pid; int needs_console; - int n; char *scon = NULL; int rc; @@ -596,10 +594,10 @@ void execute_one_command(void) 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; } @@ -1021,9 +1019,6 @@ int main(int argc, char **argv) { 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 869dff2..a124fa2 100644 --- a/init/init_parser.c +++ b/init/init_parser.c @@ -187,19 +187,14 @@ static int push_chars(char **dst, int *len, const char *chars, int cnt) 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 $. @@ -879,7 +874,6 @@ static void parse_line_action(struct parse_state* state, int nargs, char **args) { 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 @@ typedef struct { 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_control_mac_perms(const char *name, char *sctx) */ 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 @@ void handle_property_set_fd() 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, |