aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2013-07-03 15:08:47 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:23 +0200
commitc6419f03c9d6f1e2732b96a463b217c0b5ee1248 (patch)
tree1a0c568984ff88cd84f60dc759eb16f11f61aea1
parent21ca872d2d31e30d75102d2d13838fa1f1814b3c (diff)
idr: print a stack dump after ida_remove warning
We print a dump stack after idr_remove warning. This is useful to find the faulty piece of code. Let's do the same for ida_remove, as it would be equally useful there. [akpm@linux-foundation.org: convert the open-coded printk+dump_stack into WARN()] Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Tejun Heo <tj@kernel.org> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--lib/idr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/idr.c b/lib/idr.c
index 99c892364..4d797f54a 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -524,9 +524,7 @@ EXPORT_SYMBOL(idr_alloc_cyclic);
static void idr_remove_warning(int id)
{
- printk(KERN_WARNING
- "idr_remove called for id=%d which is not allocated.\n", id);
- dump_stack();
+ WARN(1, "idr_remove called for id=%d which is not allocated.\n", id);
}
static void sub_remove(struct idr *idp, int shift, int id)
@@ -1062,8 +1060,7 @@ void ida_remove(struct ida *ida, int id)
return;
err:
- printk(KERN_WARNING
- "ida_remove called for id=%d which is not allocated.\n", id);
+ WARN(1, "ida_remove called for id=%d which is not allocated.\n", id);
}
EXPORT_SYMBOL(ida_remove);