diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index ca1f1d56c..a87042738 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -298,17 +298,15 @@ int dev_cache_init(void) return 0; } -iterate_fn _check_closed(void *data) +void _check_closed(struct device *dev) { - struct device *dev = (struct device *) data; - if (dev->fd >= 0) log_err("Device '%s' has been left open.", dev_name(dev)); } static inline void _check_for_open_devices(void) { - hash_iterate(_cache.names, _check_closed); + hash_iterate(_cache.names, (iterate_fn)_check_closed); } void dev_cache_exit(void)