From c78f9ec47ba92b74698dacdae963dbbefd9b676f Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Thu, 2 Aug 2018 17:29:34 +0000 Subject: lib/log: Switch to pb_log_fn The only functional change should be an additional '/n' to a few log messagees that seemed to be missing it. Signed-off-by: Geoff Levand Signed-off-by: Samuel Mendoza-Jonas --- ui/common/discover-client.c | 20 ++++++++++---------- ui/common/joystick.c | 4 ++-- ui/common/ps3.c | 18 +++++++++--------- ui/common/timer.c | 2 +- ui/common/ui-system.c | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) (limited to 'ui/common') diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 88d0b4e..d941497 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -197,7 +197,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_device(dev, message); if (rc) { - pb_log("%s: no device?\n", __func__); + pb_log_fn("no device?\n"); goto out; } @@ -208,7 +208,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_boot_option(opt, message); if (rc) { - pb_log("%s: no boot_option?\n", __func__); + pb_log_fn("no boot_option?\n"); goto out; } @@ -217,7 +217,7 @@ static int discover_client_process(void *arg) case PB_PROTOCOL_ACTION_DEVICE_REMOVE: dev_id = pb_protocol_deserialise_string(ctx, message); if (!dev_id) { - pb_log("%s: no device id?\n", __func__); + pb_log_fn("no device id?\n"); goto out; } device_remove(client, dev_id); @@ -227,7 +227,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_boot_status(status, message); if (rc) { - pb_log("%s: invalid status message?\n", __func__); + pb_log_fn("invalid status message?\n"); goto out; } update_status(client, status); @@ -237,7 +237,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_system_info(sysinfo, message); if (rc) { - pb_log("%s: invalid sysinfo message?\n", __func__); + pb_log_fn("invalid sysinfo message?\n"); goto out; } update_sysinfo(client, sysinfo); @@ -247,7 +247,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_config(config, message); if (rc) { - pb_log("%s: invalid config message?\n", __func__); + pb_log_fn("invalid config message?\n"); goto out; } update_config(client, config); @@ -257,7 +257,7 @@ static int discover_client_process(void *arg) rc = pb_protocol_deserialise_plugin_option(p_opt, message); if (rc) { - pb_log("%s: no plugin_option?\n", __func__); + pb_log_fn("no plugin_option?\n"); goto out; } @@ -267,7 +267,7 @@ static int discover_client_process(void *arg) plugins_remove(client); break; default: - pb_log("%s: unknown action %d\n", __func__, message->action); + pb_log_fn("unknown action %d\n", message->action); } out: @@ -291,7 +291,7 @@ struct discover_client* discover_client_init(struct waitset *waitset, client->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (client->fd < 0) { - pb_log("%s: socket: %s\n", __func__, strerror(errno)); + pb_log_fn("socket: %s\n", strerror(errno)); goto out_err; } @@ -304,7 +304,7 @@ struct discover_client* discover_client_init(struct waitset *waitset, strcpy(addr.sun_path, PB_SOCKET_PATH); if (connect(client->fd, (struct sockaddr *)&addr, sizeof(addr))) { - pb_log("%s: connect: %s\n", __func__, strerror(errno)); + pb_log_fn("connect: %s\n", strerror(errno)); goto out_err; } diff --git a/ui/common/joystick.c b/ui/common/joystick.c index a3d6abd..f75ae3d 100644 --- a/ui/common/joystick.c +++ b/ui/common/joystick.c @@ -47,7 +47,7 @@ int pjs_process_event(const struct pjs *pjs) result = read(pjs->fd, &e, sizeof(e)); if (result != sizeof(e)) { - pb_log("%s: read failed: %s\n", __func__, strerror(errno)); + pb_log_fn("read failed: %s\n", strerror(errno)); return 0; } @@ -86,7 +86,7 @@ struct pjs *pjs_init(void *ctx, int (*map)(const struct js_event *)) pjs->fd = open(dev_name, O_RDONLY | O_NONBLOCK); if (pjs->fd < 0) { - pb_log("%s: open %s failed: %s\n", __func__, dev_name, + pb_log_fn("open %s failed: %s\n", dev_name, strerror(errno)); goto out_err; } diff --git a/ui/common/ps3.c b/ui/common/ps3.c index c9b97b5..d2a57a5 100644 --- a/ui/common/ps3.c +++ b/ui/common/ps3.c @@ -79,7 +79,7 @@ static int ps3_flash_open(struct ps3_flash_ctx *fc, const char *mode) fc->dev = fopen(flash_dev, mode); if (!fc->dev) { - pb_log("%s: fopen failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("fopen failed: %s: %s\n", strerror(errno), flash_dev); return -1; } @@ -89,7 +89,7 @@ static int ps3_flash_open(struct ps3_flash_ctx *fc, const char *mode) result = os_area_fixed_read(&fc->header, &fc->params, fc->dev); if (result) { - pb_log("%s: os_area_fixed_read failed\n", __func__); + pb_log_fn("os_area_fixed_read failed\n"); goto fail; } @@ -123,7 +123,7 @@ int ps3_flash_get_values(struct ps3_flash_values *values) ps3_flash_close(&fc); if (result) { - pb_log("%s: os_area_db_read failed: %s\n", __func__, + pb_log_fn("os_area_db_read failed: %s\n", strerror(errno)); goto fail; } @@ -176,14 +176,14 @@ int ps3_flash_set_values(const struct ps3_flash_values *values) result = os_area_db_read(&fc.db, &fc.header, fc.dev); if (result) { - pb_log("%s: os_area_db_read failed: %s\n", __func__, + pb_log_fn("os_area_db_read failed: %s\n", strerror(errno)); - pb_log("%s: formating db\n", __func__); + pb_log_fn("formating db\n"); result = os_area_db_format(&fc.db, &fc.header, fc.dev); if (result) { - pb_log("%s: db_format failed: %s\n", __func__, + pb_log_fn("db_format failed: %s\n", strerror(errno)); goto fail; } @@ -220,7 +220,7 @@ static int ps3_video_ioctl(int request, unsigned int *mode_id) fd = open(fb_dev, O_RDWR); if (fd < 0) { - pb_log("%s: open failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("open failed: %s: %s\n", strerror(errno), fb_dev); return -1; } @@ -230,7 +230,7 @@ static int ps3_video_ioctl(int request, unsigned int *mode_id) close(fd); if (result < 0) { - pb_log("%s: ioctl failed: %s: %s\n", __func__, strerror(errno), + pb_log_fn("ioctl failed: %s: %s\n", strerror(errno), fb_dev); return -1; } @@ -266,6 +266,6 @@ int ps3_get_video_mode(unsigned int *mode_id) result = ps3_video_ioctl(PS3FB_IOCTL_GETMODE, mode_id); - pb_log("%s: %u\n", __func__, *mode_id); + pb_log_fn("%u\n", *mode_id); return result; } diff --git a/ui/common/timer.c b/ui/common/timer.c index b0cae0d..23c3e62 100644 --- a/ui/common/timer.c +++ b/ui/common/timer.c @@ -35,7 +35,7 @@ void ui_timer_init(struct waitset *waitset, struct ui_timer *timer, unsigned int seconds) { - pb_log("%s: %u\n", __func__, seconds); + pb_log_fn("%u\n", seconds); timer->timeout = seconds; timer->waitset = waitset; } diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c index 7e04801..02142db 100644 --- a/ui/common/ui-system.c +++ b/ui/common/ui-system.c @@ -78,7 +78,7 @@ unsigned int pb_elf_hash(const char *str) h ^= g >> 24; h &= ~g; } - pb_log("%s: %x\n", __func__, h); + pb_log_fn("%x\n", h); return h; } -- cgit v1.2.1