All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: exit: reparent: cleanup the changing of ->parent
Date: Mon, 17 Nov 2014 19:58:49 +0000	[thread overview]
Message-ID: <20141117195849.GG4905@mwanda> (raw)
In-Reply-To: <20141114085410.GA9293@mwanda>

On Mon, Nov 17, 2014 at 07:42:28PM +0100, Oleg Nesterov wrote:
> On 11/14, Dan Carpenter wrote:
> >
> > The patch eb6d8479b73d: "exit: reparent: cleanup the changing of
> > ->parent" from Nov 13, 2014, leads to the following static checker
> > warning:
> >
> > 	kernel/exit.c:543 forget_original_parent()
> > 	warn: add some parenthesis here?
> >
> > kernel/exit.c
> >    538          /* Can drop and reacquire tasklist_lock */
> >    539          reaper = find_new_reaper(father);
> >    540          list_for_each_entry(p, &father->children, sibling) {
> >    541                  for_each_thread(p, t) {
> >    542                          t->real_parent = reaper;
> >    543                          BUG_ON(!t->ptrace != (t->parent = father));
> >                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > The reason for this warning is that many people forget that ! is higher
> > precedence than =.
> 
> Do you really think we should try to shut up this warning?
> 
> IMO this warning is wrong, "!A = B" or "!A != B" looks fine to me...
> 

Most of the time when Smatch prints a warning about those then it's a
bug.  It's a mix of precedence bugs and adding accidental negates.

I'll send a patch to put some parenthesis around the negate.

regards,
dan carpenter


      parent reply	other threads:[~2014-11-17 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14  8:54 exit: reparent: cleanup the changing of ->parent Dan Carpenter
2014-11-17 18:42 ` Oleg Nesterov
2014-11-17 19:58 ` Dan Carpenter [this message]

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=20141117195849.GG4905@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.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 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.