From 8588a18ac34af5d0752af3b20abccf04ca5b16b8 Mon Sep 17 00:00:00 2001 From: Yunmi Ha Date: Fri, 22 Feb 2019 15:21:39 +0900 Subject: [PATCH] Apply consistent log messages. 1. First letter to uppercase. 2. Period at the end. 3. Rearrange parameters. Change-Id: Ic28e18d4f09a2b3a89517db25498c7b8c191a61f Signed-off-by: Yunmi Ha --- src/cpu/pmqos-plugin.c | 8 ++--- src/cpu/pmqos.c | 36 +++++++++---------- src/devicectl/devicectl.c | 36 +++++++++---------- src/devicectl/usb.c | 18 +++++----- src/dump/dump.c | 10 +++--- src/extcon/cradle.c | 10 +++--- src/extcon/earjack.c | 4 +-- src/extcon/extcon.c | 50 +++++++++++++------------- src/extcon/hdmi.c | 8 ++--- src/ir/ir.c | 16 ++++----- src/led/noti.c | 8 ++--- src/led/rgb.c | 50 +++++++++++++------------- src/led/torch.c | 18 +++++----- src/led/touch-key.c | 14 ++++---- src/libdeviced/deviced-noti.c | 24 ++++++------- src/libdeviced/deviced-util.c | 4 +-- src/libdeviced/display.c | 28 +++++++-------- src/libdeviced/haptic.c | 10 +++--- src/libdeviced/led.c | 6 ++-- src/libdeviced/usbhost.c | 12 +++---- src/power/low-power.c | 26 +++++++------- src/power/power-handler.c | 82 +++++++++++++++++++++---------------------- 22 files changed, 239 insertions(+), 239 deletions(-) mode change 100644 => 100755 src/cpu/pmqos-plugin.c mode change 100644 => 100755 src/cpu/pmqos.c mode change 100644 => 100755 src/devicectl/devicectl.c mode change 100644 => 100755 src/devicectl/usb.c mode change 100644 => 100755 src/dump/dump.c mode change 100644 => 100755 src/extcon/cradle.c mode change 100644 => 100755 src/extcon/earjack.c mode change 100644 => 100755 src/extcon/extcon.c mode change 100644 => 100755 src/extcon/hdmi.c mode change 100644 => 100755 src/ir/ir.c mode change 100644 => 100755 src/led/noti.c mode change 100644 => 100755 src/led/rgb.c mode change 100644 => 100755 src/led/torch.c mode change 100644 => 100755 src/led/touch-key.c mode change 100644 => 100755 src/libdeviced/deviced-noti.c mode change 100644 => 100755 src/libdeviced/deviced-util.c mode change 100644 => 100755 src/libdeviced/display.c mode change 100644 => 100755 src/libdeviced/haptic.c mode change 100644 => 100755 src/libdeviced/led.c mode change 100644 => 100755 src/libdeviced/usbhost.c mode change 100644 => 100755 src/power/low-power.c mode change 100644 => 100755 src/power/power-handler.c diff --git a/src/cpu/pmqos-plugin.c b/src/cpu/pmqos-plugin.c old mode 100644 new mode 100755 index 775fa79..be46494 --- a/src/cpu/pmqos-plugin.c +++ b/src/cpu/pmqos-plugin.c @@ -59,7 +59,7 @@ static int pmqos_parse_scenario(struct parse_result *result, void *data) scenarios->num = SCENARIO_MAX; scenarios->list = malloc(sizeof(struct scenario)*scenarios->num); if (!scenarios->list) { - _E("failed to allocat memory for scenario"); + _E("Failed to allocat memory for scenario."); return -errno; } } @@ -116,7 +116,7 @@ static int pmqos_load_config(struct parse_result *result, void *user_data) if (MATCH(result->section, "PmqosScenario")) { ret = pmqos_parse_scenario(result, user_data); if (ret < 0) - _E("failed to parse [PmqosScenario] section : %d", ret); + _E("Failed to parse 'PmqosScenario' section: %d", ret); return ret; } @@ -127,7 +127,7 @@ static int pmqos_load_config(struct parse_result *result, void *user_data) if (MATCH(result->section, name)) { ret = pmqos_parse_each_scenario(result, user_data, index); if (ret < 0) - _E("failed to parse [Scenario%d] section : %d", index, ret); + _E("Failed to parse 'Scenario%d' section: %d", index, ret); return ret; } } @@ -153,7 +153,7 @@ int get_pmqos_table(const char *path, struct pmqos_scenario *scenarios) /* get configuration file */ ret = config_parse(path, pmqos_load_config, scenarios); if (ret < 0) { - _E("failed to load conficuration file(%s) : %d", path, ret); + _E("Failed to load conficuration file(%s): %d", path, ret); release_pmqos_table(scenarios); return ret; } diff --git a/src/cpu/pmqos.c b/src/cpu/pmqos.c old mode 100644 new mode 100755 index 66f12df..af9a681 --- a/src/cpu/pmqos.c +++ b/src/cpu/pmqos.c @@ -59,7 +59,7 @@ int set_cpu_pmqos(const char *name, int val) if (!cpu_dev || !cpu_dev->start_boost || !cpu_dev->stop_boost) { - _E("cpu device HAL does not exist"); + _E("Cpu device HAL does not exist."); return -ENODEV; } @@ -67,11 +67,11 @@ int set_cpu_pmqos(const char *name, int val) return -EINVAL; if (val) { - _D("Set pm scenario : [Lock ]%s", name); + _D("Set pm scenario. Lock %s.", name); return cpu_dev->start_boost((void *)name); } - _D("Set pm scenario : [Unlock]%s", name); + _D("Set pm scenario. Unlock %s.", name); return cpu_dev->stop_boost((void *)name); } @@ -129,7 +129,7 @@ static int pmqos_unlock_timer_start(void) clock_gettime(CLOCK_REALTIME, &unlock_timer_start_st); unlock_timer = g_timeout_add(unlock_timer_owner.timeout, pmqos_cpu_timer, NULL); if (unlock_timer == 0) { - _E("fail init pmqos unlock %s %d", cpu->name, cpu->timeout); + _E("Failed to init pmqos unlock. name=%s timeout=%d", cpu->name, cpu->timeout); return -EPERM; } break; @@ -178,7 +178,7 @@ static gboolean pmqos_cpu_timer(gpointer data) ret = pmqos_cpu_cancel(unlock_timer_owner.name); if (ret < 0) - _E("Can not find %s request", unlock_timer_owner.name); + _E("Can not find %s request.", unlock_timer_owner.name); unlock_timer = 0; return G_SOURCE_REMOVE; @@ -210,7 +210,7 @@ static int pmqos_cpu_request(const char *name, int val) /* Check valid parameter */ if (val > DEFAULT_PMQOS_TIMER) { - _I("The timer value cannot be higher than default time value(%dms)", DEFAULT_PMQOS_TIMER); + _I("The timer value cannot be higher than default time value(%dms).", DEFAULT_PMQOS_TIMER); val = DEFAULT_PMQOS_TIMER; } @@ -340,7 +340,7 @@ static int get_methods_from_conf(const char *path, dbus_method_s **dbus_methods) /* allocate dbus methods structure */ methods = malloc(sizeof(dbus_method_s) * scenarios.num); if (!methods) { - _E("failed to allocate methods memory : %d", errno); + _E("Failed to allocate methods memory: %d", errno); /* release scenarios memory */ release_pmqos_table(&scenarios); return -errno; @@ -351,7 +351,7 @@ static int get_methods_from_conf(const char *path, dbus_method_s **dbus_methods) /* if this scenario does not support */ if (!scenarios.list[i].support) { - _I("do not support [%s] scenario", scenarios.list[i].name); + _I("Do not support '%s' scenario.", scenarios.list[i].name); continue; } @@ -359,7 +359,7 @@ static int get_methods_from_conf(const char *path, dbus_method_s **dbus_methods) methods[i].signature_in = "i"; methods[i].signature_out = "i"; methods[i].func = dbus_pmqos_handler; - _D("support [%s] scenario", scenarios.list[i].name); + _D("Support '%s' scenario.", scenarios.list[i].name); } *dbus_methods = methods; @@ -447,17 +447,17 @@ static int booting_done(void *data) done = *(int *)data; if (!done) goto out; - _I("booting done"); + _I("Booting done."); /* register dbus methods */ ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_PMQOS, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); /* get methods from config file */ size = get_methods_from_conf(PMQOS_CONF_PATH, &methods); if (size < 0) - _E("failed to load configuration file(%s)", PMQOS_CONF_PATH); + _E("Failed to load configuration file(%s).", PMQOS_CONF_PATH); /* register dbus methods for pmqos */ if (methods) { @@ -465,12 +465,12 @@ static int booting_done(void *data) dbus_interface_conf.nr_methods = size; ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_PMQOS, &dbus_interface_conf); if (ret < 0) - _E("fail to init dbus method from conf(%d)", ret); + _E("Failed to init dbus method from conf: %d", ret); free(methods); } if (dbus_handle_register_dbus_object_all(NULL) < 0) - _E("Failed to register dbus method! %d", ret); + _E("Failed to register dbus method: %d", ret); /* register notifier for each event */ register_notifier(DEVICE_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat); @@ -491,22 +491,22 @@ static int pmqos_probe(void *data) r = hw_get_info(CPU_HARDWARE_DEVICE_ID, (const struct hw_info **)&info); if (r < 0) { - _I("cpu shared library is not supported: %d", r); + _I("Cpu shared library is not supported: %d", r); return -ENODEV; } if (!info->open) { - _E("fail to open cpu device : open(NULL)"); + _E("Failed to open cpu device: open(NULL)"); return -EPERM; } r = info->open(info, NULL, (struct hw_common **)&cpu_dev); if (r < 0) { - _E("fail to get cpu device structure : %d", r); + _E("Failed to get cpu device structure: %d", r); return -EPERM; } - _D("cpu device structure load success"); + _D("Cpu device structure load success."); return 0; } diff --git a/src/devicectl/devicectl.c b/src/devicectl/devicectl.c old mode 100644 new mode 100755 index 52455f2..4b820d5 --- a/src/devicectl/devicectl.c +++ b/src/devicectl/devicectl.c @@ -68,7 +68,7 @@ static int start_device(char **args) if (!args[1]) return -EINVAL; - printf("start %s device!\n", args[1]); + printf("Start %s device.\n", args[1]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -90,7 +90,7 @@ static int stop_device(char **args) if (!args[1]) return -EINVAL; - printf("stop %s device!\n", args[1]); + printf("Stop %s device.\n", args[1]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -112,7 +112,7 @@ static int dump_mode(char **args) if (!args[1] || !args[2] || !args[3]) return -EINVAL; - printf("%s (%s %s)!\n", args[1], args[2], args[3]); + printf("%s (%s %s).\n", args[1], args[2], args[3]); ret = dbus_handle_method_async_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -120,7 +120,7 @@ static int dump_mode(char **args) "Dumpmode", g_variant_new("(s)", args[3])); if (ret < 0) - printf("failed to set dump mode (%d)", ret); + printf("Failed to set dump mode: %d", ret); return ret; } @@ -132,7 +132,7 @@ static int save_log(char **args) if (!args[1]) return -EINVAL; - printf("save log %s device!\n", args[1]); + printf("Save log %s device.\n", args[1]); ret = dbus_handle_method_async(DEVICED_BUS_NAME, devices[arg_id].path, @@ -140,7 +140,7 @@ static int save_log(char **args) "SaveLog", NULL, NULL); if (ret < 0) - printf("failed to save log (%d)", ret); + printf("Failed to save log: %d", ret); return ret; } @@ -177,7 +177,7 @@ static int save_dbus_name(char **args) if (!args[1]) return -EINVAL; - printf("save dbus name!\n"); + printf("Save dbus name.\n"); msg = dbus_handle_method_sync_with_reply_var(DBUS_BUS_NAME, DBUS_OBJECT_PATH, @@ -185,17 +185,17 @@ static int save_dbus_name(char **args) "ListNames", NULL); if (!msg) { - printf("failed to get list names"); + printf("Failed to get list names."); return -EBADMSG; } if (!dh_get_param_from_var(msg, "(as)", &iter)) { - printf("invalid list name arguments!"); + printf("Invalid list name arguments."); g_variant_unref(msg); return -EINVAL; } - printf("%" G_GSIZE_FORMAT " connections\n", g_variant_iter_n_children(iter)); + printf("%" G_GSIZE_FORMAT " connections.\n", g_variant_iter_n_children(iter)); while (g_variant_iter_loop(iter, "s", &str)) { pid = dbus_handle_get_sender_pid(NULL, str); @@ -216,7 +216,7 @@ static int device_list(char **args) if (!args[1]) return -EINVAL; - printf("print %s to dlog!\n", args[1]); + printf("Print %s to dlog.\n", args[1]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -248,7 +248,7 @@ static int enable_device(char **args) if (!args[3]) return -EINVAL; - printf("enable %s device!\n", args[3]); + printf("Enable %s device.\n", args[3]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -270,7 +270,7 @@ static int disable_device(char **args) if (!args[3]) return -EINVAL; - printf("disable %s device!\n", args[3]); + printf("Disable %s device.\n", args[3]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -292,7 +292,7 @@ static int power_operation(char **args, char *type) if (!args[1] || !type) return -EINVAL; - printf("Power %s device!\n", args[2]); + printf("Power %s device.\n", args[2]); msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME, devices[arg_id].path, @@ -342,7 +342,7 @@ static const struct action { static inline void usage() { printf("[usage] devicectl \n"); - printf("Please use option --help to check options\n"); + printf("Please use option --help to check options.\n"); } static void help() @@ -387,7 +387,7 @@ int main(int argc, char *argv[]) break; if (i >= ARRAY_SIZE(devices)) { - printf("invalid device name! %s\n", argv[1]); + printf("Invalid device name. %s\n", argv[1]); usage(); return -EINVAL; } @@ -400,13 +400,13 @@ int main(int argc, char *argv[]) break; if (i >= ARRAY_SIZE(actions)) { - printf("invalid action name! %s\n", argv[2]); + printf("Invalid action name. %s\n", argv[2]); usage(); return -EINVAL; } if (actions[i].argc != argc) { - printf("invalid arg count!\n"); + printf("Invalid arg count.\n"); usage(); return -EINVAL; } diff --git a/src/devicectl/usb.c b/src/devicectl/usb.c old mode 100644 new mode 100755 index 9c3403f..37bc468 --- a/src/devicectl/usb.c +++ b/src/devicectl/usb.c @@ -56,7 +56,7 @@ static int launch_app(char **argv) pid = fork(); if (pid < 0) { - printf("fork() failed\n"); + printf("Failed to call fork().\n"); return -ENOMEM; } @@ -67,7 +67,7 @@ static int launch_app(char **argv) /*child*/ if (execvp(argv[0], argv) < 0) - printf("execvp failed (%d)\n", errno); + printf("Failed to call execvp: %d\n", errno); return 0; } @@ -82,14 +82,14 @@ static int write_sysfs(char *path, char *value) fp = fopen(path, "w"); if (!fp) { - printf("FAIL: fopen(%s)\n", path); + printf("Failed to open '%s'.\n", path); return -ENOMEM; } ret = fwrite(value, sizeof(char), strlen(value), fp); fclose(fp); if (ret < strlen(value)) { - printf("FAIL: fwrite(%s)\n", value); + printf("Failed to write '%s'.\n", value); ret = -ENOMEM; } @@ -107,7 +107,7 @@ static int set_usb_configuration(char *idproduct, char *fconf, char *sconf) for (i = 0; i < ARRAY_SIZE(usb_confs); i++) { ret = write_sysfs(usb_confs[i].path, usb_confs[i].value); if (ret < 0) { - printf("usb setting fails (%s), (%s)\n", usb_confs[i].path, usb_confs[i].value); + printf("Failed to write usb setting. path=%s value=%s\n", usb_confs[i].path, usb_confs[i].value); return ret; } } @@ -251,7 +251,7 @@ static int unload_ssh(void) int load_usb_mode(char *opt) { if (!opt) { - printf("Failed: Forth parameter is NULL\n"); + printf("Failed: Forth parameter is NULL.\n"); return -EINVAL; } @@ -261,14 +261,14 @@ int load_usb_mode(char *opt) if (!strncmp(opt, USB_SSH, strlen(opt))) return load_ssh(); - printf("Failed: Forth parameter is invalid (%s)\n", opt); + printf("Failed: Forth parameter(%s) is invalid.\n", opt); return -EINVAL; } int unload_usb_mode(char *opt) { if (!opt) { - printf("Failed: Forth parameter is NULL\n"); + printf("Failed: Forth parameter is NULL.\n"); return -EINVAL; } @@ -278,6 +278,6 @@ int unload_usb_mode(char *opt) if (!strncmp(opt, USB_SSH, strlen(opt))) return unload_ssh(); - printf("Failed: Forth parameter is invalid (%s)\n", opt); + printf("Failed: Forth parameter(%s) is invalid.\n", opt); return -EINVAL; } diff --git a/src/dump/dump.c b/src/dump/dump.c old mode 100644 new mode 100755 index f16e617..b89ecc2 --- a/src/dump/dump.c +++ b/src/dump/dump.c @@ -63,12 +63,12 @@ static void dump_all_devices(int mode, char *path) if (path) fp = fopen(fname, "w+"); if (!fp) - _I("Failed to open %s, print to DLOG", fname); + _I("Failed to open '%s', print to DLOG.", fname); /* save dump each device ops */ DD_LIST_FOREACH(head, elem, dev) { if (dev->dump) { - _D("[%s] get dump", dev->name); + _D("[%s] Get dump.", dev->name); LOG_DUMP(fp, "\n==== %s\n\n", dev->name); dev->dump(fp, mode, dev->dump_data); } @@ -81,7 +81,7 @@ static void dump_all_devices(int mode, char *path) /* send finish signal to dump service */ send_dump_signal(DUMP_FINISH_SIGNAL); - _D("%s(%d) dump is saved!", fname, mode); + _D("Dump(%s:%d) is saved!", fname, mode); } static void dump_signal_handler(GDBusConnection *conn, @@ -97,7 +97,7 @@ static void dump_signal_handler(GDBusConnection *conn, char *log_path = NULL; g_variant_get(param, "(is)", &mode, &log_path); - _D("mode(%d) path(%s)", mode, log_path); + _D("mode=%d path=%s", mode, log_path); dump_all_devices(mode, log_path); g_free(log_path); @@ -115,7 +115,7 @@ static void dump_init(void *data) dump_signal_handler, NULL, NULL); if (ret <= 0) - _E("Failed to register signal handler! %d", ret); + _E("Failed to register signal handler: %d", ret); } static const struct device_ops dump_device_ops = { diff --git a/src/extcon/cradle.c b/src/extcon/cradle.c old mode 100644 new mode 100755 index f8d2c41..f212081 --- a/src/extcon/cradle.c +++ b/src/extcon/cradle.c @@ -40,7 +40,7 @@ static void cradle_send_broadcast(int status) if (old == status) return; - _I("broadcast cradle status %d", status); + _I("Broadcast cradle status(%d).", status); old = status; dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI, @@ -51,12 +51,12 @@ static void cradle_send_broadcast(int status) static int cradle_update(int status) { - _I("jack - cradle changed %d", status); + _I("Cradle changed. status=%d", status); if (disp_plgn.pm_change_internal) disp_plgn.pm_change_internal(INTERNAL_LOCK_CRADLE, LCD_NORMAL); cradle_send_broadcast(status); if (vconf_set_int(VCONFKEY_SYSMAN_CRADLE_STATUS, status) != 0) { - _E("failed to set vconf status"); + _E("Failed to set vconf status."); return -EIO; } @@ -87,7 +87,7 @@ static int display_changed(void *data) if (cradle == DOCK_SOUND) { if (disp_plgn.pm_lock_internal) disp_plgn.pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0); - _I("sound dock is connected! dim lock is on."); + _I("Sound dock is connected. Dim lock is on."); } return 0; @@ -120,7 +120,7 @@ static void cradle_init(void *data) ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); } static void cradle_exit(void *data) diff --git a/src/extcon/earjack.c b/src/extcon/earjack.c old mode 100644 new mode 100755 index fcb9d52..0928cb6 --- a/src/extcon/earjack.c +++ b/src/extcon/earjack.c @@ -37,7 +37,7 @@ static void earjack_send_broadcast(int status) if (old == status) return; - _I("broadcast earjack status %d", status); + _I("Broadcast earjack status(%d).", status); old = status; dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI, @@ -64,7 +64,7 @@ static void earjack_send_system_event(int status) static int earjack_update(int status) { - _I("jack - earjack changed %d", status); + _I("Earjack changed. status=%d", status); vconf_set_int(VCONFKEY_SYSMAN_EARJACK, status); earjack_send_broadcast(status); earjack_send_system_event(status); diff --git a/src/extcon/extcon.c b/src/extcon/extcon.c old mode 100644 new mode 100755 index a54f1d2..881e355 --- a/src/extcon/extcon.c +++ b/src/extcon/extcon.c @@ -104,7 +104,7 @@ static int extcon_update(const char *name, const char *value) if (dev->status == status) return 0; - _I("Changed %s device : %d -> %d", name, dev->status, status); + _I("Changed %s device: %d to %d.", name, dev->status, status); dev->status = status; @@ -117,7 +117,7 @@ static int extcon_update(const char *name, const char *value) METHOD_SYSPOPUP_SHOW, g_variant_new("(s)", buf)); if (ret < 0) - _E("Failed to launch USB restricted popup(%d)", ret); + _E("Failed to launch USB restricted popup: %d", ret); return ret; } else return 0; @@ -139,7 +139,7 @@ int extcon_enable_device(const char *name) return -ENODEV; if (dev->enabled) { - _I("extcon(%s) already enabled", name); + _I("Extcon(%s) already enabled.", name); return 0; } @@ -149,13 +149,13 @@ int extcon_enable_device(const char *name) if (strncmp(name, "USB", strlen("USB")) == 0) { ret = extcon_update("USB", "0"); if (ret != 0) - _E("fail to disconnect USB"); + _E("Failed to disconnect USB."); ret = extcon_update("USB", "1"); if (ret != 0) - _E("fail to connect USB"); + _E("Failed to connect USB."); } - _I("extcon(%s) enabled", name); + _I("Extcon(%s) enabled.", name); return 0; } @@ -177,17 +177,17 @@ int extcon_disable_device(const char *name) METHOD_SYSPOPUP_SHOW, g_variant_new("(s)", buf)); if (ret < 0) - _E("Failed to launch USB restricted popup(%d)", ret); + _E("Failed to launch USB restricted popup: %d", ret); if (!dev->enabled) { - _I("extcon(%s) already disabled", name); + _I("Extcon(%s) already disabled.", name); return 0; } dev->exit(NULL); dev->enabled = false; - _I("extcon(%s) disabled", name); + _I("Extcon(%s) disabled.", name); return 0; } @@ -229,7 +229,7 @@ static void uevent_extcon_handler(struct udev_device *dev) ret = extcon_parsing_value(env_value); if (ret < 0) - _E("fail to parse extcon value : %d", ret); + _E("Failed to parse extcon value: %d", ret); } static int extcon_load_uevent(struct parse_result *result, void *user_data) @@ -255,7 +255,7 @@ static int get_extcon_init_state(void) dir = opendir(EXTCON_PATH); if (!dir) { ret = -errno; - _E("Cannot open dir (%s, errno:%d)", EXTCON_PATH, ret); + _E("Cannot open dir(%s): %d", EXTCON_PATH, ret); return ret; } @@ -265,13 +265,13 @@ static int get_extcon_init_state(void) continue; snprintf(node, sizeof(node), "%s/%s/state", EXTCON_PATH, result->d_name); - _I("checking node (%s)", node); + _I("Checking node(%s).", node); if (access(node, F_OK) != 0) continue; ret = config_parse(node, extcon_load_uevent, NULL); if (ret < 0) - _E("fail to parse %s data : %d", node, ret); + _E("Failed to parse %s data: %d", node, ret); } if (dir) @@ -292,13 +292,13 @@ static GVariant * dbus_get_extcon_status(GDBusConnection *conn, dev = find_extcon(str); if (!dev) { - _E("fail to matched extcon device : %s", str); + _E("Failed to matched extcon(%s) device.", str); ret = -ENOENT; goto error; } ret = dev->status; - _D("Extcon device : %s, status : %d", dev->name, dev->status); + _D("Extcon(%s) device status=%d", dev->name, dev->status); error: g_free(str); @@ -380,17 +380,17 @@ static int extcon_probe(void *data) (const struct hw_info **)&info); if (ret == 0) { if (!info->open) { - _E("Failed to open extcon device; open(NULL)"); + _E("Failed to open extcon device: open(NULL)"); return -ENODEV; } ret = info->open(info, NULL, (struct hw_common **)&extcon_dev); if (ret < 0) { - _E("Failed to get extcon device structure (%d)", ret); + _E("Failed to get extcon device structure: %d", ret); return ret; } - _I("extcon device structure load success"); + _I("Extcon device structure load success."); return 0; } @@ -400,7 +400,7 @@ static int extcon_probe(void *data) * deviced does not control extcon devices. */ if (access(EXTCON_PATH, R_OK) != 0) { - _E("there is no extcon class"); + _E("There is no extcon class."); return -ENODEV; } @@ -422,12 +422,12 @@ static void add_extcon_event_handler(void) /* register extcon uevent */ ret = register_kernel_uevent_control(&uh); if (ret < 0) - _E("fail to register extcon uevent : %d", ret); + _E("Failed to register extcon uevent: %d", ret); /* load the initialize value by accessing the node directly */ ret = get_extcon_init_state(); if (ret < 0) - _E("fail to init extcon nodes : %d", ret); + _E("Failed to init extcon nodes: %d", ret); } } @@ -442,7 +442,7 @@ static void remove_extcon_event_handler(void) /* unreigster extcon uevent */ ret = unregister_kernel_uevent_control(&uh); if (ret < 0) - _E("fail to unregister extcon uevent : %d", ret); + _E("Failed to unregister extcon uevent: %d", ret); } } @@ -476,7 +476,7 @@ static void extcon_init(void *data) /* initialize extcon devices */ DD_LIST_FOREACH(extcon_list, l, dev) { - _I("[extcon] init (%s)", dev->name); + _I("Extcon(%s) init.", dev->name); if (dev->init) dev->init(data); dev->enabled = true; @@ -486,7 +486,7 @@ static void extcon_init(void *data) ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_EXTCON, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); register_notifier(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); @@ -504,7 +504,7 @@ static void extcon_exit(void *data) /* deinitialize extcon devices */ DD_LIST_FOREACH(extcon_list, l, dev) { - _I("[extcon] deinit (%s)", dev->name); + _I("Extcon(%s) deinit.", dev->name); if (dev->exit) dev->exit(data); dev->enabled = false; diff --git a/src/extcon/hdmi.c b/src/extcon/hdmi.c old mode 100644 new mode 100755 index 5e2612e..cc6e747 --- a/src/extcon/hdmi.c +++ b/src/extcon/hdmi.c @@ -37,7 +37,7 @@ static void hdmi_send_broadcast(int status) if (old == status) return; - _I("broadcast hdmi status %d", status); + _I("Broadcast hdmi status(%d)", status); old = status; dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI, @@ -48,7 +48,7 @@ static void hdmi_send_broadcast(int status) static int hdmi_update(int status) { - _I("jack - hdmi changed %d", status); + _I("Hdmi changed. status=%d", status); if (disp_plgn.pm_change_internal) disp_plgn.pm_change_internal(INTERNAL_LOCK_HDMI, LCD_NORMAL); vconf_set_int(VCONFKEY_SYSMAN_HDMI, status); @@ -81,7 +81,7 @@ static int display_changed(void *data) if (hdmi == 0) { if (disp_plgn.pm_lock_internal) disp_plgn.pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0); - _I("hdmi is connected! dim lock is on."); + _I("Hdmi is connected. Dim lock is on."); } return 0; } @@ -113,7 +113,7 @@ static void hdmi_init(void *data) ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); } static void hdmi_exit(void *data) diff --git a/src/ir/ir.c b/src/ir/ir.c old mode 100644 new mode 100755 index 4132ff7..7197411 --- a/src/ir/ir.c +++ b/src/ir/ir.c @@ -81,7 +81,7 @@ static GVariant *dbus_ir_transmit(GDBusConnection *conn, g_variant_iter_free(iter); - _I("frequency : %d, pattern_size: %d", freq_pattern[0], size); + _I("frequency=%d pattern_size=%d", freq_pattern[0], size); ret = ir_dev->transmit(freq_pattern, size); @@ -96,7 +96,7 @@ static GVariant *dbus_set_ir_command(GDBusConnection *conn, { int ret = -ENOTSUP; - _E("The method is not supported. Use device_ir_transmit() of capi-system-device"); + _E("The method is not supported. Use device_ir_transmit() of capi-system-device."); return g_variant_new("(i)", ret); } @@ -139,22 +139,22 @@ static int ir_probe(void *data) (const struct hw_info **)&info); if (ret < 0) { - _E("Fail to load ir(%d)", ret); + _E("Failed to load ir: %d", ret); return -ENODEV; } if (!info->open) { - _E("Failed to open ir device; open(NULL)"); + _E("Failed to open ir device: open(NULL)"); return -ENODEV; } ret = info->open(info, NULL, (struct hw_common**)&ir_dev); if (ret < 0) { - _E("Failed to get ir device structure (%d)", ret); + _E("Failed to get ir device structure: %d", ret); return ret; } - _I("ir device structure load success"); + _I("Ir device structure load success."); return 0; } @@ -164,11 +164,11 @@ static void ir_init(void *data) ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_IR, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface_legacy); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); } diff --git a/src/led/noti.c b/src/led/noti.c old mode 100644 new mode 100755 index ffc4002..522cf99 --- a/src/led/noti.c +++ b/src/led/noti.c @@ -33,7 +33,7 @@ int ongoing_show(void) int ret_val; if (noti_h > 0) { - _D("already ongoing noti show : handle(%d)", noti_h); + _D("Already ongoing noti show handle(%d).", noti_h); return 0; } @@ -44,7 +44,7 @@ int ongoing_show(void) NULL, NULL); noti_h = ret_val; - _D("insert noti handle : %d", noti_h); + _D("Insert noti handle(%d).", noti_h); return (ret_val < 0) ? ret_val : 0; } @@ -53,7 +53,7 @@ int ongoing_clear(void) int ret_val; if (noti_h <= 0) { - _D("already ongoing noti clear"); + _D("Already ongoing noti clear."); return 0; } @@ -63,7 +63,7 @@ int ongoing_clear(void) METHOD_TORCH_NOTI_OFF, g_variant_new("(i)", noti_h)); - _D("delete noti handle : %d", noti_h); + _D("Delete noti handle(%d).", noti_h); noti_h = 0; return ret_val; } diff --git a/src/led/rgb.c b/src/led/rgb.c old mode 100644 new mode 100755 index 2c320f2..59fb9f5 --- a/src/led/rgb.c +++ b/src/led/rgb.c @@ -70,7 +70,7 @@ static int remove_req_from_list(pid_t pid) DD_LIST_FOREACH(rgb_list, l, req) { if (req->pid == pid) { - _I("remove rgb play request from pid (%d)", pid); + _I("Remove rgb play request from pid(%d).", pid); if (req == top) top = NULL; DD_LIST_REMOVE(rgb_list, req); @@ -94,7 +94,7 @@ static int add_req_to_list(pid_t pid, struct led_state *state) if (ret < 0) { req = calloc(1, sizeof(struct rgb_request)); if (!req) { - _E("calloc() failed"); + _E("Failed to call calloc()."); return -ENOMEM; } req->pid = pid; @@ -116,12 +116,12 @@ static int rgb_play(struct led_state *state) struct led_state off = { 0, }; if (!rgb_dev) { - _E("There is NO HAL"); + _E("There is NO HAL."); return -ENODEV; } if (!rgb_dev->set_state) { - _E("LED HAL does not support set_state()"); + _E("LED HAL does not support set_state()."); return -ENOTSUP; } @@ -141,14 +141,14 @@ static gboolean remove_not_handled_req(gpointer data) if (kill(req->pid, 0) == -1) { ret = remove_req_from_list(req->pid); if (ret < 0) - _E("Failed to remove rgb request (%d)", ret); + _E("Failed to remove rgb request: %d", ret); } } if (!top) { ret = rgb_play(NULL); if (ret < 0) - _E("Failed to turn off removed request (%d)", ret); + _E("Failed to turn off removed request: %d", ret); } if (DD_LIST_LENGTH(rgb_list) == 0) { @@ -166,7 +166,7 @@ static void add_timer_to_check_invalid_req(void) timer = g_timeout_add(5000, remove_not_handled_req, NULL); if (timer == 0) - _E("Failed to add timer"); + _E("Failed to add timer."); } static int get_led_num(void) @@ -179,20 +179,20 @@ static int get_led_num(void) return num_of_leds; if (!rgb_dev) { - _E("There is NO HAL"); + _E("There is NO HAL."); ret = -ENODEV; goto out; } if (!rgb_dev->get_number) { - _E("LED HAL does not support get_number()"); + _E("LED HAL does not support get_number()."); ret = -ENOTSUP; goto out; } ret = rgb_dev->get_number(); if (ret < 0) { - _E("Failed to get LED number : %d", ret); + _E("Failed to get LED number: %d", ret); goto out; } @@ -217,7 +217,7 @@ static GVariant *dbus_playcustom(GDBusConnection *conn, pid = dbus_connection_get_sender_pid(conn, sender); - _I("pid %d led play custom %d, %d, %x", pid, on, off, color); + _I("Pid(%d) led play custom on=%d off=%d color=%x.", pid, on, off, color); state.color = color; state.duty_on = on; @@ -229,7 +229,7 @@ static GVariant *dbus_playcustom(GDBusConnection *conn, ret = rgb_play(&state); if (ret < 0) { - _E("Failed to play LED notification (%d)", ret); + _E("Failed to play LED notification: %d", ret); goto out; } @@ -249,18 +249,18 @@ static GVariant *dbus_stopcustom(GDBusConnection *conn, pid = dbus_connection_get_sender_pid(conn, sender); - _I("pid %d led stop custom", pid); + _I("Pid(%d) led stop custom.", pid); ret = remove_req_from_list(pid); if (ret < 0) { - _E("There is no request from pid (%d) to remove", pid); + _E("There is no request from pid(%d) to remove.", pid); goto out; } if (!top) { ret = rgb_play(NULL); if (ret < 0) { - _E("Failed to play LED notification (%d)", ret); + _E("Failed to play LED notification: %d", ret); goto out; } } @@ -293,7 +293,7 @@ static GVariant *dbus_multi_led_control(GDBusConnection *conn, pid = dbus_connection_get_sender_pid(conn, sender); - _I("pid %d multi led play control", pid); + _I("Pid(%d) multi led play control.", pid); ret = get_led_num(); if (ret < 0) @@ -304,7 +304,7 @@ static GVariant *dbus_multi_led_control(GDBusConnection *conn, g_variant_get(param, "(au)", &iter); size = g_variant_iter_n_children(iter); if (num_of_leds != size) { - _E("Led number is not matched"); + _E("Led number is not matched."); ret = -EINVAL; goto out; } @@ -324,7 +324,7 @@ static GVariant *dbus_multi_led_control(GDBusConnection *conn, state.color = color[i]; ret = rgb_play(&state); if (ret < 0) - _E("Failed to play LED notification (%d)", ret); + _E("Failed to play LED notification: %d.", ret); ++i; } @@ -359,18 +359,18 @@ static void rgb_init(void *data) ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); ret = rgb_play(NULL); if (ret < 0) - _E("Failed to turn off rgb play during init"); + _E("Failed to turn off rgb play during init."); } static void rgb_exit(void *data) { int ret = rgb_play(NULL); if (ret < 0) - _E("Failed to turn off rgb play during exit"); + _E("Failed to turn off rgb play during exit."); } static int rgb_probe(void *data) @@ -384,22 +384,22 @@ static int rgb_probe(void *data) ret = hw_get_info(LED_HARDWARE_DEVICE_ID, (const struct hw_info **)&info); if (ret < 0) { - _E("There is no LED HAL"); + _E("There is no LED HAL."); return -ENOTSUP; } if (!info->open) { - _E("Failed to open led device; open(NULL)"); + _E("Failed to open led device: open(NULL)"); return -ENODEV; } ret = info->open(info, LED_ID_NOTIFICATION, (struct hw_common **)&rgb_dev); if (ret < 0) { - _E("Failed to get LED NOTIFICATION device structure (%d)", ret); + _E("Failed to get LED NOTIFICATION device structure: %d", ret); return ret; } - _I("LED NOTIFICATION device structure load success"); + _I("LED NOTIFICATION device structure load success."); return 0; } diff --git a/src/led/torch.c b/src/led/torch.c old mode 100644 new mode 100755 index 719d673..0d9e887 --- a/src/led/torch.c +++ b/src/led/torch.c @@ -57,7 +57,7 @@ static GVariant *dbus_get_brightness(GDBusConnection *conn, int ret, alpha; if (!led_dev) { - _E("there is no led device"); + _E("There is no led device."); ret = -ENOENT; goto error; } @@ -66,7 +66,7 @@ static GVariant *dbus_get_brightness(GDBusConnection *conn, ret = alpha * 100.f / 255; if (alpha != 0 && alpha != 0xFF) ret += 1; - _D("color : val(%d), color(%x)", ret, led_state.color); + _D("Get brightness. color=%x: %d", led_state.color, ret); error: return g_variant_new("(i)", ret); @@ -93,13 +93,13 @@ static GVariant *dbus_set_brightness(GDBusConnection *conn, g_variant_get(param, "(ii)", &val, &enable); if (!led_dev) { - _E("there is no led device"); + _E("There is no led device."); ret = -ENOENT; goto error; } tmp.color = (((int)(val * 255.f) / LED_MAX_BRIGHTNESS) & 0xFF) << 24; - _D("color : val(%d), color(%x)", val, tmp.color); + _D("Set brightness. val=%d color=%x", val, tmp.color); ret = led_dev->set_state(&tmp); if (ret < 0) @@ -152,23 +152,23 @@ static int led_service_load(void) r = hw_get_info(LED_HARDWARE_DEVICE_ID, (const struct hw_info **)&info); if (r < 0) { - _E("fail to load led shared library : %d", r); + _E("Failed to load led shared library: %d", r); return -ENOENT; } if (!info->open) { - _E("fail to open camera led device : open(NULL)"); + _E("Fail to open camera led device: open(NULL)"); return -EPERM; } r = info->open(info, LED_ID_CAMERA_BACK, (struct hw_common **)&led_dev); if (r < 0) { - _E("fail to get camera led device : %d", r); + _E("Failed to get camera led device: %d", r); return -EPERM; } - _D("camera led device structure load success"); + _D("Camera led device structure load success."); return 0; } @@ -201,7 +201,7 @@ static void torch_init(void *data) /* init dbus interface */ ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); } static void torch_exit(void *data) diff --git a/src/led/touch-key.c b/src/led/touch-key.c old mode 100644 new mode 100755 index fcc9141..0f1ac2f --- a/src/led/touch-key.c +++ b/src/led/touch-key.c @@ -54,7 +54,7 @@ static int touchled_set_state(bool on) int r; if (!touchled_dev || !touchled_dev->set_state) { - _E("there is no led device"); + _E("There is no led device."); return -ENOENT; } @@ -65,7 +65,7 @@ static int touchled_set_state(bool on) r = touchled_dev->set_state(&tmp); if (r < 0) { - _E("fail to set touch led state : %d", r); + _E("Failed to set touch led state: %d", r); return r; } @@ -212,23 +212,23 @@ static int touchled_service_load(void) r = hw_get_info(LED_HARDWARE_DEVICE_ID, (const struct hw_info **)&info); if (r < 0) { - _E("fail to load led shared library : %d", r); + _E("Failed to load led shared library: %d", r); return -ENOENT; } if (!info->open) { - _E("fail to open touch led device : open(NULL)"); + _E("Failed to open touch led device: open(NULL)"); return -EPERM; } r = info->open(info, LED_ID_TOUCH_KEY, (struct hw_common **)&touchled_dev); if (r < 0) { - _E("fail to get touch led device : %d", r); + _E("Failed to get touch led device: %d", r); return -EPERM; } - _D("touch led device structure load success"); + _D("Touch led device structure load success."); return 0; } @@ -262,7 +262,7 @@ static void touchled_init(void *data) { /* get touchkey light duration setting */ if (vconf_get_int(VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION, &hardkey_duration) < 0) { - _W("Fail to get VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION!!"); + _W("Failed to get VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION."); hardkey_duration = KEYBACKLIGHT_TIME_90; } diff --git a/src/libdeviced/deviced-noti.c b/src/libdeviced/deviced-noti.c old mode 100644 new mode 100755 index c217cab..5741fe6 --- a/src/libdeviced/deviced-noti.c +++ b/src/libdeviced/deviced-noti.c @@ -68,12 +68,12 @@ static int dbus_proc_handler(char* type, char *buf) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); val = -EBADMSG; goto out; } - _D("%s-%s : %d", DEVICED_INTERFACE_PROCESS, type, val); + _D("%s-%s: %d", DEVICED_INTERFACE_PROCESS, type, val); out: g_variant_unref(msg); @@ -122,12 +122,12 @@ static int dbus_power_handler(char* type) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); val = -EBADMSG; goto out; } - _D("%s-%s : %d", DEVICED_INTERFACE_POWER, type, val); + _D("%s-%s: %d", DEVICED_INTERFACE_POWER, type, val); out: g_variant_unref(msg); @@ -166,12 +166,12 @@ static int dbus_time_handler(char* type, char* buf) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); val = -EBADMSG; goto out; } - _SI("[%s] %s-%s(%s) : %d", name, DEVICED_INTERFACE_SYSNOTI, type, buf, val); + _SI("[%s] %s-%s(%s): %d", name, DEVICED_INTERFACE_SYSNOTI, type, buf, val); out: g_variant_unref(msg); @@ -189,7 +189,7 @@ static int alarm_set_time(time_t timet) ret = deviced_get_cmdline_name(pid, name, sizeof(name)); if (ret != 0) snprintf(name, sizeof(name), "%d", pid); - _SI("[%s]start %s %ld", name, ALARM_INTERFACE_NAME, timet); + _SI("[%s]start %s %ld.", name, ALARM_INTERFACE_NAME, timet); msg = dbus_handle_method_sync_with_reply_var(ALARM_BUS_NAME, ALARM_PATH_NAME, @@ -197,17 +197,17 @@ static int alarm_set_time(time_t timet) ALARM_SET_TIME_METHOD, g_variant_new("(i)", timet)); if (!msg) { - _E("dbus_message_new_method_call(%s:%s-%s)", + _E("Failed to call dbus_message_new_method_call(%s:%s-%s).", ALARM_PATH_NAME, ALARM_INTERFACE_NAME, ALARM_SET_TIME_METHOD); return -EBADMSG; } if (!dh_get_param_from_var(msg, "(i)", &val)) { - _E("no message : type(%s)", g_variant_get_type_string(msg)); + _E("Failed to get type(%s): no message", g_variant_get_type_string(msg)); val = -EBADMSG; } - _SI("[%s]end %s %ld, %d", name, ALARM_INTERFACE_NAME, timet, val); + _SI("[%s]End %s %ld: %d", name, ALARM_INTERFACE_NAME, timet, val); g_variant_unref(msg); @@ -244,12 +244,12 @@ static int dbus_cpu_handler(char* type, char* buf_pid, char* buf_freq) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); val = -EBADMSG; goto out; } - _D("%s-%s : %d", DEVICED_INTERFACE_SYSNOTI, type, val); + _D("%s-%s: %d", DEVICED_INTERFACE_SYSNOTI, type, val); out: g_variant_unref(msg); return val; diff --git a/src/libdeviced/deviced-util.c b/src/libdeviced/deviced-util.c old mode 100644 new mode 100755 index 044b0bf..6f73b5f --- a/src/libdeviced/deviced-util.c +++ b/src/libdeviced/deviced-util.c @@ -45,7 +45,7 @@ API int deviced_get_pid(const char *execpath) dp = opendir("/proc"); if (!dp) { - _E("open /proc"); + _E("Failed to open '/proc'."); return -1; } @@ -101,7 +101,7 @@ API int deviced_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size) close(fd); if (ret < 0) { ret = -errno; - _E("read() failed (%d)", ret); + _E("Failed to read(): %d", ret); return ret; } buf[PATH_MAX] = '\0'; diff --git a/src/libdeviced/display.c b/src/libdeviced/display.c old mode 100644 new mode 100755 index 73a2ec5..4f3eebd --- a/src/libdeviced/display.c +++ b/src/libdeviced/display.c @@ -71,7 +71,7 @@ API int display_get_max_brightness(void) if (ret < 0) return DISPLAY_MAX_BRIGHTNESS; - _D("get max brightness : %d", ret); + _D("Get max brightness: %d", ret); return ret; } @@ -88,7 +88,7 @@ API int display_set_brightness_with_setting(int val) METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", DISPLAY_STATE_NORMAL, val)); if (ret < 0) - _E("no message : failed to setting"); + _E("Failed to set brightness: no message."); return ret; } @@ -117,14 +117,14 @@ static void display_change_cb(GVariant *var, void *user_data, GError *err) return; if (!dh_get_param_from_var(var, "(i)", &val)) { - _E("no message [%s]", g_variant_get_type_string(var)); + _E("Failed to get(%s): no message", g_variant_get_type_string(var)); g_variant_unref(var); return; } g_variant_unref(var); - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, val); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, val); } API int display_change_state(unsigned int s_bits) @@ -145,9 +145,9 @@ API int display_change_state(unsigned int s_bits) -1, NULL); if (ret < 0) - _E("no message : failed to change state"); + _E("Failed to change state: no message"); - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, ret); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, ret); return ret; } @@ -160,11 +160,11 @@ static void display_lock_cb(GVariant *var, void *user_data, GError *err) return; if (!dh_get_param_from_var(var, "(i)", &val)) { - _E("no message [%s]", g_variant_get_type_string(var)); + _E("Failed to get(%s): no message", g_variant_get_type_string(var)); goto out; } - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, val); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, val); out: g_variant_unref(var); @@ -203,9 +203,9 @@ API int display_lock_state(unsigned int s_bits, unsigned int flag, -1, NULL); if (ret < 0) - _E("no message : failed to lock state"); + _E("Failed to lock state: no message"); - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, ret); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, ret); return ret; } @@ -218,11 +218,11 @@ static void display_unlock_cb(GVariant *var, void *user_data, GError *err) return; if (!dh_get_param_from_var(var, "(i)", &val)) { - _E("no message [%s]", g_variant_get_type_string(var)); + _E("Failed to get(%s): no message", g_variant_get_type_string(var)); goto out; } - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, val); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, val); out: g_variant_unref(var); @@ -262,9 +262,9 @@ API int display_unlock_state(unsigned int s_bits, unsigned int flag) -1, NULL); if (ret < 0) - _E("no message : failed to unlock state"); + _E("Failed to unlock state: no message"); - _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, ret); + _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, ret); return ret; } diff --git a/src/libdeviced/haptic.c b/src/libdeviced/haptic.c old mode 100644 new mode 100755 index c788c4a..9fc789c --- a/src/libdeviced/haptic.c +++ b/src/libdeviced/haptic.c @@ -34,30 +34,30 @@ API int haptic_get_count(int *device_number) { - _E("Not Supported, Please use capi-system-device apis"); + _E("Not Supported. Please use capi-system-device apis."); return HAPTIC_ERROR_OPERATION_FAILED; } API int haptic_open(haptic_device_e device_index, haptic_device_h *device_handle) { - _E("Not Supported, Please use capi-system-device apis"); + _E("Not Supported. Please use capi-system-device apis."); return HAPTIC_ERROR_OPERATION_FAILED; } API int haptic_close(haptic_device_h device_handle) { - _E("Not Supported, Please use capi-system-device apis"); + _E("Not Supported. Please use capi-system-device apis."); return HAPTIC_ERROR_OPERATION_FAILED; } API int haptic_vibrate_monotone(haptic_device_h device_handle, int duration, haptic_effect_h *effect_handle) { - _E("Not Supported, Please use capi-system-device apis"); + _E("Not Supported. Please use capi-system-device apis."); return HAPTIC_ERROR_OPERATION_FAILED; } API int haptic_stop_all_effects(haptic_device_h device_handle) { - _E("Not Supported, Please use capi-system-device apis"); + _E("Not Supported. Please use capi-system-device apis."); return HAPTIC_ERROR_OPERATION_FAILED; } diff --git a/src/libdeviced/led.c b/src/libdeviced/led.c old mode 100644 new mode 100755 index bf152b4..dd93631 --- a/src/libdeviced/led.c +++ b/src/libdeviced/led.c @@ -44,7 +44,7 @@ API int led_get_brightness(void) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &ret_val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); ret_val = -EBADMSG; } @@ -67,7 +67,7 @@ API int led_get_max_brightness(void) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &ret_val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); ret_val = -EBADMSG; } @@ -90,7 +90,7 @@ API int led_set_brightness_with_noti(int val, bool enable) return -EBADMSG; if (!dh_get_param_from_var(msg, "(i)", &ret_val)) { - _E("fail (signature:%s): no message", g_variant_get_type_string(msg)); + _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg)); ret_val = -EBADMSG; } diff --git a/src/libdeviced/usbhost.c b/src/libdeviced/usbhost.c old mode 100644 new mode 100755 index c36aa46..94396bf --- a/src/libdeviced/usbhost.c +++ b/src/libdeviced/usbhost.c @@ -59,7 +59,7 @@ static int register_signal_handler(const char *path, const char *iface, const ch handler = (struct signal_handler *)calloc(1, sizeof(struct signal_handler)); if (!handler) { - _E("No memory"); + _E("Failed to calloc: No memory"); ret = -1; goto out; } @@ -68,7 +68,7 @@ static int register_signal_handler(const char *path, const char *iface, const ch handler->data = data; handler->id = subscribe_dbus_signal(NULL, path, iface, name, cb, NULL, NULL); if (!handler->id) { - _E("fail to add dbus handler"); + _E("Failed to add dbus handler."); ret = -1; goto out; } @@ -150,7 +150,7 @@ static void device_signal_handler(GDBusConnection *conn, API int init_usbhost_signal(void) { - _D("init"); + _D("Init."); return 0; } @@ -329,15 +329,15 @@ API int open_usb_device(char *path, int *out_fd) &fdlist, &size); if (!reply) { - _E("Unable to open USB device"); + _E("Unable to open USB device."); return -1; } if (size == 0) { - _E("failed to get fd list"); + _E("Failed to get fd list."); return -1; } if (!dh_get_param_from_var(reply, "(i)", &ret)) { - _E("no message [%s]", g_variant_get_type_string(reply)); + _E("Failed to get(%s): no message.", g_variant_get_type_string(reply)); ret = -1; goto out; } diff --git a/src/power/low-power.c b/src/power/low-power.c old mode 100644 new mode 100755 index ab1719a..27ba800 --- a/src/power/low-power.c +++ b/src/power/low-power.c @@ -48,12 +48,12 @@ static int low_power_start(void *data) ret = vconf_set_int(VCONFKEY_SYSMAN_LOW_POWER_MODE, VCONFKEY_SYSMAN_LOW_POWER_MODE_ON); if (ret != 0) { - _E("Failed to enable low power mode"); + _E("Failed to enable low power mode."); return -ENOMEM; } low_power_enabled = true; - _I("Low Power Mode Start"); + _I("Low Power Mode Start."); return 0; } @@ -68,12 +68,12 @@ static int low_power_stop(void *data) ret = vconf_set_int(VCONFKEY_SYSMAN_LOW_POWER_MODE, VCONFKEY_SYSMAN_LOW_POWER_MODE_OFF); if (ret != 0) { - _E("Failed to disable low power mode"); + _E("Failed to disable low power mode."); return -ENOMEM; } low_power_enabled = false; - _I("Low Power Mode Stop"); + _I("Low Power Mode Stop."); return 0; } @@ -92,7 +92,7 @@ static int booting_done(void *data) ret = vconf_get_int(VCONFKEY_SYSMAN_LOW_POWER_MODE, &mode); if (ret == 0 && mode == VCONFKEY_SYSMAN_LOW_POWER_MODE_ON) { - _I("Low Power Mode Start"); + _I("Low Power Mode Start."); low_power_enabled = true; } @@ -108,17 +108,17 @@ GVariant *dbus_low_power_start(GDBusConnection *conn, pid_t pid; if (!booting_done(NULL)) { - _I("Booting is not done yet"); + _I("Booting is not done yet."); ret = -EAGAIN; goto out; } pid = dbus_connection_get_sender_pid(conn, sender); - _I("Low Power Mode started by PID(%d)", pid); + _I("Low Power Mode started by PID(%d).", pid); ret = low_power_start(NULL); if (ret < 0) - _E("Failed to start Low Power Mode(%d)", ret); + _E("Failed to start Low Power Mode(%d).", ret); out: return g_variant_new("(i)", ret); @@ -131,17 +131,17 @@ GVariant *dbus_low_power_stop(GDBusConnection *conn, pid_t pid; if (!booting_done(NULL)) { - _I("Booting is not done yet"); + _I("Booting is not done yet."); ret = -EAGAIN; goto out; } pid = dbus_connection_get_sender_pid(conn, sender); - _I("Low Power Mode stopped by PID(%d)", pid); + _I("Low Power Mode stopped by PID(%d).", pid); ret = low_power_stop(NULL); if (ret < 0) - _E("Failed to stop Low Power Mode(%d)", ret); + _E("Failed to stop Low Power Mode(%d).", ret); out: return g_variant_new("(i)", ret); @@ -175,7 +175,7 @@ static void low_power_init(void *data) /* init dbus interface */ ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LOWPOWER, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method(%d).", ret); register_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done); } @@ -186,7 +186,7 @@ static void low_power_exit(void *data) ret = low_power_stop(NULL); if (ret < 0) - _E("Failed to stop Low Power Mode(%d)", ret); + _E("Failed to stop Low Power Mode(%d).", ret); unregister_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done); } diff --git a/src/power/power-handler.c b/src/power/power-handler.c old mode 100644 new mode 100755 index 6d35ec1..7dafc14 --- a/src/power/power-handler.c +++ b/src/power/power-handler.c @@ -113,14 +113,14 @@ static void poweroff_start_animation(void) ret = systemd_start_unit_async("shutdown-animation.service", NULL); if (ret < 0) - _E("Failed to start shutdown animation"); + _E("Failed to start shutdown animation."); gettimeofday(&tv_start_poweroff, NULL); } static void poweroff_notify_resourced(void) { - _I("Request to stop systemd service to resourced"); + _I("Request to stop systemd service to resourced."); dbus_handle_method_sync_timeout(RESOURCED_BUS_NAME, RESOURCED_PATH_PROCESS, RESOURCED_INTERFACE_PROCESS, @@ -158,13 +158,13 @@ static int disable_systemd_journald(void) ret = systemd_stop_unit_async("systemd-journald.socket", NULL); if (ret < 0) { - _E("failed to stop 'systemd-journald.socket'"); + _E("Failed to stop 'systemd-journald.socket'."); return ret; } ret = systemd_stop_unit_async("systemd-journald.service", NULL); if (ret < 0) { - _E("failed to stop 'systemd-journald.service'"); + _E("Failed to stop 'systemd-journald.service'."); return ret; } return 0; @@ -186,14 +186,14 @@ static bool disable_coredump_handler(void) } bool is_ok = ret > 0; - _I("Disabling core dumps %s", is_ok ? "succeeded" : "failed"); + _I("Disabling core dumps %s.", is_ok ? "succeeded" : "failed"); return is_ok; } static void poweroff_request_shutdown() { - _I("Requested power off via systemd"); + _I("Requested power off via systemd."); char *method; @@ -204,7 +204,7 @@ static void poweroff_request_shutdown() else if (poweroff_opt.type == POWER_OFF_EXIT) method = "Exit"; else { - _E("poweroff invalid type (%d)", poweroff_opt.type); + _E("Poweroff invalid type(%d).", poweroff_opt.type); return; } @@ -240,7 +240,7 @@ void powerdown(void) check_duration = now.tv_sec - tv_start_poweroff.tv_sec; while (check_duration < poweroff_duration) { if (wait == 0) { - _I("wait poweroff %d %d", check_duration, poweroff_duration); + _I("Wait poweroff %d %d.", check_duration, poweroff_duration); wait = 1; } usleep(100000); @@ -283,14 +283,14 @@ static void make_power_flag(enum poweroff_type type, char *option) fd = open(path, O_RDWR|O_CREAT, S_IRUSR | S_IWUSR); if (fd < 0) { - _E("Failed to create (%s)", path); + _E("Failed to create '%s'.", path); return; } if (option) { len = write(fd, option, strlen(option)); if (len <= 0) - _E("Failed to store option (%zd)", len < 0 ? errno : len); + _E("Failed to store option: %zd", len < 0 ? errno : len); } close(fd); @@ -308,7 +308,7 @@ static void poweroff_remove_handle(pid_t pid) assert(handle); - _D("Remove handle pid(%d) timeout(%d) timeout_id(%d)", handle->pid, handle->timeout, handle->timeout_id); + _D("Remove handle pid=%d timeout=%d timeout_id=%d.", handle->pid, handle->timeout, handle->timeout_id); DD_LIST_REMOVE(poweroff_handles, handle); if (handle->timeout_id) { @@ -327,14 +327,14 @@ static gboolean poweroff_timeout_cb(void *data) poweroff_remove_handle(pid); if (DD_LIST_LENGTH(poweroff_handles)) { - _D("Timer is left"); + _D("Timer is left."); return G_SOURCE_REMOVE; } - _D("No timer left"); + _D("No timer left."); char *name = poweroff_type_to_name(poweroff_opt.type); if (!name) { - _E("Invalid type (%d)", poweroff_opt.type); + _E("Invalid type(%d).", poweroff_opt.type); goto out; } @@ -371,11 +371,11 @@ void poweroff_start_timers() DD_LIST_FOREACH(poweroff_handles, l, handle) { pid_alive = kill(handle->pid, 0); if (pid_alive == -1) { - _D("Pid(%d) is dead", handle->pid); + _D("Pid(%d) is dead.", handle->pid); handle->timeout = 0; } - _D("Run timer, pid(%d) timeout(%d) timeout_id(%d)", handle->pid, handle->timeout, handle->timeout_id); + _D("Run timer, pid=%d timeout=%d timeout_id=%d.", handle->pid, handle->timeout, handle->timeout_id); handle->timeout_id = g_timeout_add_seconds(handle->timeout, poweroff_timeout_cb, (void *)((intptr_t)(handle->pid))); @@ -386,7 +386,7 @@ void poweroff_start_timers() if (timer_exist) { return; } else { - _D("handle is NULL"); + _D("Handle is NULL."); handle = (struct poweroff_handle *)malloc(sizeof(struct poweroff_handle)); if (handle == NULL) { _E("Not enough memory."); @@ -400,7 +400,7 @@ void poweroff_start_timers() (void *)((intptr_t)(handle->pid))); if (!handle->timeout_id) { - _E("timer_add failed"); + _E("Failed to timer_add."); free(handle); return; } @@ -408,7 +408,7 @@ void poweroff_start_timers() DD_LIST_APPEND(poweroff_handles, handle); } - _D("Last Timer : timer_id(%d) pid(%d) timeout(%d)", handle->timeout_id, handle->pid, handle->timeout); + _D("Last Timer: timer_id=%d pid=%d timeout=%d", handle->timeout_id, handle->pid, handle->timeout); return; } @@ -459,7 +459,7 @@ static void poweroff_send_broadcast(int status) if (old == status) return; - _D("broadcast poweroff %d", status); + _D("Broadcast poweroff %d.", status); old = status; @@ -473,13 +473,13 @@ static void poweroff_send_broadcast(int status) static int power_execute_pid(char *type, char *option, pid_t pid) { if (during_poweroff) { - _E("during poweroff"); + _E("During poweroff."); return -EINVAL; } enum poweroff_type type_e = poweroff_name_to_type(type); if (type_e == POWER_OFF_INVALID) { - _E("Failed to get type enum value (%d)", type_e); + _E("Failed to get type enum value(%d).", type_e); return -EINVAL; } if (poweroff_option_valid(type_e, option)) { @@ -489,12 +489,12 @@ static int power_execute_pid(char *type, char *option, pid_t pid) if (option) poweroff_opt.option = strdup(option); } else { - _E("Failed to find supported %s option %s", type, (option ? option : "NULL")); + _E("Failed to find supported type(%s). option=%s", type, (option ? option : "NULL")); return -EINVAL; } if (poweroff_opt.type == POWER_OFF_POPUP) { - _D("request popup"); + _D("Request popup."); vconf_set_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, poweroff_opt.type); pwroff_popup(); return 0; @@ -525,19 +525,19 @@ GVariant *dbus_power_handler(GDBusConnection *conn, g_variant_get(param, "(si)", &type_str, &argc); if (argc < 0) { - _E("message is invalid!"); + _E("Message is invalid."); ret = -EINVAL; goto out; } pid = dbus_connection_get_sender_pid(conn, sender); if (kill(pid, 0) == -1) { - _E("%d process does not exist, dbus ignored!", pid); + _E("Process(%d) does not exist, dbus ignored.", pid); ret = -ESRCH; goto out; } - _I("poweroff PID(%d) requests %s", pid, type_str); + _I("Poweroff PID(%d) requests %s.", pid, type_str); ret = power_execute_pid(type_str, NULL, pid); out: @@ -557,12 +557,12 @@ GVariant *dbus_power_option_handler(GDBusConnection *conn, pid = dbus_connection_get_sender_pid(conn, sender); if (kill(pid, 0) == -1) { - _E("%d process does not exist, dbus ignored!", pid); + _E("Process(%d) does not exist, dbus ignored.", pid); ret = -ESRCH; goto out; } - _I("poweroff PID(%d) requests %s %s", pid, type, option); + _I("Poweroff PID(%d) requests type=%s option=%s.", pid, type, option); ret = power_execute_pid(type, option, pid); out: @@ -583,7 +583,7 @@ GVariant *request_reboot(GDBusConnection *conn, pid = dbus_connection_get_sender_pid(conn, sender); - _I("poweroff PID(%d) requests reboot with command : %s", pid, str); + _I("Poweroff PID(%d) requests reboot with command(%s).", pid, str); ret = power_execute_pid(POWER_REBOOT, NULL, pid); g_free(str); @@ -600,7 +600,7 @@ static GVariant *add_poweroff_time(GDBusConnection *conn, dd_list *l; pid = dbus_connection_get_sender_pid(conn, sender); - _D("add_poweroff_timer(%d)", pid); + _D("add_poweroff_timer pid=%d", pid); if (pid == -1) { _E("Failed to get sender's pid."); ret = -1; @@ -615,7 +615,7 @@ static GVariant *add_poweroff_time(GDBusConnection *conn, if (handle) poweroff_remove_handle(pid); - _D("Make a new handle"); + _D("Make a new handle."); handle = (struct poweroff_handle *)malloc(sizeof(struct poweroff_handle)); if (handle == NULL) { _E("Not enough memory."); @@ -628,7 +628,7 @@ static GVariant *add_poweroff_time(GDBusConnection *conn, handle->timeout = POWEROFF_WAIT_MAX; DD_LIST_APPEND(poweroff_handles, handle); - _D("Add a new poweroff timer(%d %d %d)", handle->pid, handle->timeout, handle->timeout_id); + _D("Add a new poweroff timer. pid=%d timeout=%d timeout_id=%d)", handle->pid, handle->timeout, handle->timeout_id); ret = 0; @@ -646,7 +646,7 @@ static GVariant *remove_poweroff_time(GDBusConnection *conn, pid_t pid; pid = dbus_connection_get_sender_pid(conn, sender); - _D("remove_poweroff_timer(%d)", pid); + _D("Remove_poweroff_timer pid=%d", pid); if (pid == -1) { _E("Failed to get sender's pid."); ret = -1; @@ -669,7 +669,7 @@ static GVariant *remove_poweroff_time(GDBusConnection *conn, (void *)((intptr_t)(handle->pid))); } } else { - _E("Invalid pid(%d)", pid); + _E("Invalid pid(%d).", pid); ret = -1; } @@ -701,13 +701,13 @@ static int add_poweroff_option(enum poweroff_type type, char *option) name = poweroff_type_to_name(type); if (!name) { - _E("Invalid type (%d)", type); + _E("Invalid type(%d).", type); return -EINVAL; } opt = calloc(1, sizeof(struct power_option)); if (!opt) { - _E("calloc() failed"); + _E("Failed to calloc()."); return -ENOMEM; } @@ -716,7 +716,7 @@ static int add_poweroff_option(enum poweroff_type type, char *option) DD_LIST_APPEND(poweroff_options, opt); - _D("Add %s option (%s)", name, opt->option); + _D("Add %s option=%s", name, opt->option); return 0; } @@ -738,7 +738,7 @@ static int load_config(struct parse_result *result, void *user_data) ret = add_poweroff_option(type, result->value); if (ret < 0) { - _E("Failed to add %s option (%s)", result->section, result->value); + _E("Failed to add %s option=%s", result->section, result->value); return ret; } @@ -764,7 +764,7 @@ static void power_init(void *data) /* init dbus interface */ ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_REBOOT, &dbus_interface); if (ret < 0) - _E("fail to init dbus method(%d)", ret); + _E("Failed to init dbus method: %d", ret); add_booting_done_handler(NULL); @@ -777,7 +777,7 @@ static void power_init(void *data) ret = config_parse(POWER_CONF_FILE, load_config, NULL); if (ret < 0) - _E("Failed to load power off config (%d)", ret); + _E("Failed to load power off config: %d", ret); } static const struct device_ops power_device_ops = { -- 2.7.4