* [PATCH] mm/hugetlb: Simplify the calculation of variables
@ 2021-01-26 6:44 Jiapeng Zhong
2021-01-26 6:53 ` Miaohe Lin
2021-01-27 2:09 ` Mike Kravetz
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Zhong @ 2021-01-26 6:44 UTC (permalink / raw)
To: mike.kravetz; +Cc: akpm, linux-mm, linux-kernel, Jiapeng Zhong
Fix the following coccicheck warnings:
./mm/hugetlb.c:3372:20-22: WARNING !A || A && B is equivalent to
!A || B.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
mm/hugetlb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cbf32d2..5e6a6e7 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3367,8 +3367,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];
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/hugetlb: Simplify the calculation of variables
2021-01-26 6:44 [PATCH] mm/hugetlb: Simplify the calculation of variables Jiapeng Zhong
@ 2021-01-26 6:53 ` Miaohe Lin
2021-01-27 2:09 ` Mike Kravetz
1 sibling, 0 replies; 3+ messages in thread
From: Miaohe Lin @ 2021-01-26 6:53 UTC (permalink / raw)
To: Jiapeng Zhong; +Cc: akpm, linux-mm, linux-kernel, Mike Kravetz
Hi:
On 2021/1/26 14:44, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./mm/hugetlb.c:3372:20-22: WARNING !A || A && B is equivalent to
> !A || B.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
> mm/hugetlb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index cbf32d2..5e6a6e7 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3367,8 +3367,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];
> }
>
>
I'm gonna do this too. :)
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/hugetlb: Simplify the calculation of variables
2021-01-26 6:44 [PATCH] mm/hugetlb: Simplify the calculation of variables Jiapeng Zhong
2021-01-26 6:53 ` Miaohe Lin
@ 2021-01-27 2:09 ` Mike Kravetz
1 sibling, 0 replies; 3+ messages in thread
From: Mike Kravetz @ 2021-01-27 2:09 UTC (permalink / raw)
To: Jiapeng Zhong; +Cc: akpm, linux-mm, linux-kernel
On 1/25/21 10:44 PM, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./mm/hugetlb.c:3372:20-22: WARNING !A || A && B is equivalent to
> !A || B.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
> mm/hugetlb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Thanks,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index cbf32d2..5e6a6e7 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3367,8 +3367,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];
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-27 4:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 6:44 [PATCH] mm/hugetlb: Simplify the calculation of variables Jiapeng Zhong
2021-01-26 6:53 ` Miaohe Lin
2021-01-27 2:09 ` Mike Kravetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).