mm: memcg: Remove redundant BUG_ON() in mem_cgroup_usage_unregister_event
Subsystems (3)
PATCH 1/1 mm: memcg: 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 <[email protected]>
--- mm/memcontrol.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
mm/memcontrol.c +0 -6
@@ -4404,20 +4404,14 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,if (type == _MEM) thresholds = &memcg->thresholds;else if (type == _MEMSWAP) thresholds = &memcg->memsw_thresholds;else BUG (); -/* -* Something went wrong if we trying to unregister a threshold -* if we don't have thresholds -*/ -BUG_ON (!thresholds); - usage =mem_cgroup_usage (memcg, type == _MEMSWAP);/* Check if a threshold crossed before removing */ __mem_cgroup_threshold (memcg, type == _MEMSWAP);/* Calculate new number of threshold */ size =0 ;
Signature · 8 lines
1.7.9 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>