linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zouwei (Samuel)" <zou_wei@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: 答复: [PATCH -next] mm/usercopy: fix warning Comparison to bool
Date: Thu, 16 Apr 2020 10:45:12 +0000	[thread overview]
Message-ID: <C3CD0DF8AD11A84CB25A1426DE537C61E594BFF6@dggeml524-mbx.china.huawei.com> (raw)
In-Reply-To: <20200415160439.256c89d4cb67b76d4119935d@linux-foundation.org>

Hi Andrew,

Thanks for your reply.
Perhaps this is a detection rule of Coccinelle (coccicheck) software for programming specifications,
and it's no wrong with the code, just a coding style.

Best Regards
Zou Wei
-----邮件原件-----
发件人: Andrew Morton [mailto:akpm@linux-foundation.org] 
发送时间: 2020年4月16日 7:05
收件人: Zouwei (Samuel) <zou_wei@huawei.com>
抄送: linux-mm@kvack.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH -next] mm/usercopy: fix warning Comparison to bool

On Tue, 14 Apr 2020 11:42:04 +0800 Zou Wei <zou_wei@huawei.com> wrote:

> fix below warnings reported by coccicheck
> 
> mm/usercopy.c:304:5-18: WARNING: Comparison to bool
>
> ...
>
> --- a/mm/usercopy.c
> +++ b/mm/usercopy.c
> @@ -301,7 +301,7 @@ __setup("hardened_usercopy=", 
> parse_hardened_usercopy);
>  
>  static int __init set_hardened_usercopy(void)  {
> -	if (enable_checks == false)
> +	if (!enable_checks)
>  		static_branch_enable(&bypass_usercopy_checks);
>  	return 1;
>  }

My initial reaction is "fix coccicheck".  There's nothing wrong with that code?


  reply	other threads:[~2020-04-16 10:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  3:42 [PATCH -next] mm/usercopy: fix warning Comparison to bool Zou Wei
2020-04-15 23:04 ` Andrew Morton
2020-04-16 10:45   ` Zouwei (Samuel) [this message]
2020-04-16 11:23     ` 答复: " David Hildenbrand

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=C3CD0DF8AD11A84CB25A1426DE537C61E594BFF6@dggeml524-mbx.china.huawei.com \
    --to=zou_wei@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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).