Init: Remove unused variables
For build-system CFLAGS clean-up, fix unused variables.
Use a #define instead of static variable in a header file.
Change-Id: Id47bf38e51644b61a9f3ac1893a16553695f1aac
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");
}