Skip to content

Commit

Permalink
mm/memcontrol.c: remove redundant BUG_ON() in mem_cgroup_usage_unregi…
Browse files Browse the repository at this point in the history
…ster_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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Anton Vorontsov authored and torvalds committed Mar 22, 2012
1 parent 13fd1dd commit 45f3e38
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -4467,12 +4467,6 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
else
BUG();

/*
* Something went wrong if we trying to unregister a threshold
* if we don't have thresholds
*/
BUG_ON(!thresholds);

if (!thresholds->primary)
goto unlock;

Expand Down

0 comments on commit 45f3e38

Please sign in to comment.