From 810d3ec225cddddc95cf3b9f7058a4253ec1e486 Mon Sep 17 00:00:00 2001 From: ae Date: Sun, 30 Sep 2012 07:52:40 +0000 Subject: Fix disk_cleanup() to work without DISK_DEBUG too. --- sys/boot/common/disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/boot/common') diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c index 1fcaf2b..73d58ea 100644 --- a/sys/boot/common/disk.c +++ b/sys/boot/common/disk.c @@ -373,7 +373,9 @@ disk_close(struct disk_devdesc *dev) void disk_cleanup(const struct devsw *d_dev) { +#ifdef DISK_DEBUG struct disk_devdesc dev; +#endif struct dentry *entry, *tmp; STAILQ_FOREACH_SAFE(entry, &opened_disks, entry, tmp) { @@ -385,10 +387,10 @@ disk_cleanup(const struct devsw *d_dev) dev.d_unit = entry->d_unit; dev.d_slice = entry->d_slice; dev.d_partition = entry->d_partition; - STAILQ_REMOVE(&opened_disks, entry, dentry, entry); DEBUG("%s was freed => %p [%d]", disk_fmtdev(&dev), entry->od, entry->od->rcnt); #endif + STAILQ_REMOVE(&opened_disks, entry, dentry, entry); if (entry->od->rcnt < 1) { if (entry->od->table != NULL) ptable_close(entry->od->table); -- cgit v1.1