From: Oleg Nesterov <oleg@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Rik van Riel <riel@redhat.com>,
Ionut Alexa <ionut.m.alexa@gmail.com>,
Peter Hurley <peter@hurleysoftware.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] exit: silence a bogus static checker warning
Date: Tue, 18 Nov 2014 15:39:32 +0000 [thread overview]
Message-ID: <20141118153932.GA3790@redhat.com> (raw)
In-Reply-To: <20141118074422.GA17829@mwanda>
On 11/18, Dan Carpenter wrote:
>
> Smatch complains about this:
>
> kernel/exit.c:543 forget_original_parent()
> warn: add some parenthesis here?
>
> I don't normally advocate changing the code to make the static checker
> happy but these are normally precedence bugs so I think it's ok to put
> parenthesis so it's clear the code is deliberate.
I still think that "if (!A = B)" doesn't look as a potential precedence
bug, but I won't argue.
Andrew, this fixes exit-reparent-cleanup-the-changing-of-parent.patch
in -mm tree.
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 6192422..1192d12 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -540,7 +540,7 @@ static void forget_original_parent(struct task_struct *father)
> list_for_each_entry(p, &father->children, sibling) {
> for_each_thread(p, t) {
> t->real_parent = reaper;
> - BUG_ON(!t->ptrace != (t->parent = father));
> + BUG_ON((!t->ptrace) != (t->parent = father));
> if (likely(!t->ptrace))
> t->parent = t->real_parent;
> if (t->pdeath_signal)
WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.cz>, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Rik van Riel <riel@redhat.com>,
Ionut Alexa <ionut.m.alexa@gmail.com>,
Peter Hurley <peter@hurleysoftware.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] exit: silence a bogus static checker warning
Date: Tue, 18 Nov 2014 16:39:32 +0100 [thread overview]
Message-ID: <20141118153932.GA3790@redhat.com> (raw)
In-Reply-To: <20141118074422.GA17829@mwanda>
On 11/18, Dan Carpenter wrote:
>
> Smatch complains about this:
>
> kernel/exit.c:543 forget_original_parent()
> warn: add some parenthesis here?
>
> I don't normally advocate changing the code to make the static checker
> happy but these are normally precedence bugs so I think it's ok to put
> parenthesis so it's clear the code is deliberate.
I still think that "if (!A == B)" doesn't look as a potential precedence
bug, but I won't argue.
Andrew, this fixes exit-reparent-cleanup-the-changing-of-parent.patch
in -mm tree.
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 6192422..1192d12 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -540,7 +540,7 @@ static void forget_original_parent(struct task_struct *father)
> list_for_each_entry(p, &father->children, sibling) {
> for_each_thread(p, t) {
> t->real_parent = reaper;
> - BUG_ON(!t->ptrace != (t->parent == father));
> + BUG_ON((!t->ptrace) != (t->parent == father));
> if (likely(!t->ptrace))
> t->parent = t->real_parent;
> if (t->pdeath_signal)
next prev parent reply other threads:[~2014-11-18 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 7:44 [patch] exit: silence a bogus static checker warning Dan Carpenter
2014-11-18 7:44 ` Dan Carpenter
2014-11-18 15:39 ` Oleg Nesterov [this message]
2014-11-18 15:39 ` Oleg Nesterov
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=20141118153932.GA3790@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dan.carpenter@oracle.com \
--cc=ionut.m.alexa@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=mingo@kernel.org \
--cc=peter@hurleysoftware.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.