mm/memcontrol.c: remove redundant BUG_ON() in mem_cgroup_usage_unregister_event()

In the following code:

	if (type == _MEM)
		thresholds = &memcg->thresholds;
	else if (type == _MEMSWAP)
		thresholds = &memcg->memsw_thresholds;
	else
		BUG();

	BUG_ON(!thresholds);

The BUG_ON() seems redundant.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Anton Vorontsov 2012-03-21 16:34:26 -07:00 committed by Linus Torvalds
parent 13fd1dd9db
commit 45f3e385b7
1 changed files with 0 additions and 6 deletions

View File

@ -4467,12 +4467,6 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
else else
BUG(); BUG();
/*
* Something went wrong if we trying to unregister a threshold
* if we don't have thresholds
*/
BUG_ON(!thresholds);
if (!thresholds->primary) if (!thresholds->primary)
goto unlock; goto unlock;