From a9681dd19c18afcb6623d2af65ce1ca57e42568c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 16 Dec 2018 17:08:38 +0100 Subject: [PATCH] cleanup --- modules/battery/battery.c | 3 ++- particles/ramp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/battery/battery.c b/modules/battery/battery.c index f6b9675..05dc7e4 100644 --- a/modules/battery/battery.c +++ b/modules/battery/battery.c @@ -210,8 +210,9 @@ run(struct module_run_context *ctx) if (fds[1].revents & POLLIN) { struct udev_device *dev = udev_monitor_receive_device(mon); - bool is_us = strcmp(udev_device_get_sysname(dev), m->battery) == 0; + const char *sysname = udev_device_get_sysname(dev); + bool is_us = strcmp(sysname, m->battery) == 0; udev_device_unref(dev); if (!is_us) diff --git a/particles/ramp.c b/particles/ramp.c index c9c3c24..0e107ed 100644 --- a/particles/ramp.c +++ b/particles/ramp.c @@ -40,7 +40,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags) double progress = (double)value / (max - min); size_t idx = progress * ramp->count; - printf("value: %lu, min: %lu, max: %lu, progress: %f, idx: %zu\n", + printf("ramp: value: %lu, min: %lu, max: %lu, progress: %f, idx: %zu\n", value, min, max, progress, idx); assert(idx >= 0 && idx < ramp->count);