diff options
author | zhouchuangao <[email protected]> | 2021-05-04 18:40:00 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-05-05 11:27:27 -0700 |
commit | ecfc2bda7aafc5c87b69a3d7a1fc1016dd21d5a7 (patch) | |
tree | 6b7335a1c81636255207de32b3df75832b615e0c | |
parent | 79cd420248c776005d534416bfc9b04696e6c729 (diff) |
mm/zsmalloc: use BUG_ON instead of if condition followed by BUG.
It can be optimized at compile time.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: zhouchuangao <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/zsmalloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 30c358b72025..58697f7a43f8 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1987,8 +1987,7 @@ static int zs_page_migrate(struct address_space *mapping, struct page *newpage, head = obj_to_head(page, addr); if (head & OBJ_ALLOCATED_TAG) { handle = head & ~OBJ_ALLOCATED_TAG; - if (!testpin_tag(handle)) - BUG(); + BUG_ON(!testpin_tag(handle)); old_obj = handle_to_obj(handle); obj_to_location(old_obj, &dummy, &obj_idx); @@ -2035,8 +2034,7 @@ unpin_objects: head = obj_to_head(page, addr); if (head & OBJ_ALLOCATED_TAG) { handle = head & ~OBJ_ALLOCATED_TAG; - if (!testpin_tag(handle)) - BUG(); + BUG_ON(!testpin_tag(handle)); unpin_tag(handle); } } |