Skip to content

Commit

Permalink
mm/hugetlb: simplify the calculation of variables
Browse files Browse the repository at this point in the history
Fix the following coccicheck warnings:

  mm/hugetlb.c:3372:20-22: WARNING !A || A && B is equivalent to !A || B.

Link: https://lkml.kernel.org/r/1611643468-52233-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jiapeng Zhong authored and Linus Torvalds committed Feb 24, 2021
1 parent 1d88433 commit c93b0a9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3420,8 +3420,7 @@ static unsigned int allowed_mems_nr(struct hstate *h)
mpol_allowed = policy_nodemask_current(gfp_mask);

for_each_node_mask(node, cpuset_current_mems_allowed) {
if (!mpol_allowed ||
(mpol_allowed && node_isset(node, *mpol_allowed)))
if (!mpol_allowed || node_isset(node, *mpol_allowed))
nr += array[node];
}

Expand Down

0 comments on commit c93b0a9

Please sign in to comment.