From: Jiapeng Zhong Date: Wed, 24 Feb 2021 20:07:09 +0000 (-0800) Subject: mm/hugetlb: simplify the calculation of variables X-Git-Tag: v5.15~1642^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c93b0a99260741a4fe39c0a8b73f45f34a5b7868;p=platform%2Fkernel%2Flinux-starfive.git mm/hugetlb: simplify the calculation of variables 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 Reported-by: Abaci Robot Reviewed-by: Miaohe Lin Reviewed-by: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e8d39b0fe4bd..6920c71d7e0d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -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]; }