Re: exit: reparent: cleanup the changing of ->parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux