linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>,
	Mike Kravetz <mike.kravetz@oracle.com>
Subject: Re: [PATCH] mm/hugetlb: Simplify the calculation of variables
Date: Tue, 26 Jan 2021 14:53:18 +0800	[thread overview]
Message-ID: <3378e469-be94-956a-a53c-4067e437e604@huawei.com> (raw)
In-Reply-To: <1611643468-52233-1-git-send-email-abaci-bugfix@linux.alibaba.com>

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>

  reply	other threads:[~2021-01-26 18:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  6:44 [PATCH] mm/hugetlb: Simplify the calculation of variables Jiapeng Zhong
2021-01-26  6:53 ` Miaohe Lin [this message]
2021-01-27  2:09 ` Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3378e469-be94-956a-a53c-4067e437e604@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).