From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Alexey Gladkov <gladkov.alexey@gmail.com>,
linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Add symantic index utility
Date: Wed, 11 Mar 2020 12:07:45 +0300 [thread overview]
Message-ID: <20200311090745.GD11561@kadam> (raw)
In-Reply-To: <20200310150713.GB19012@redhat.com>
On Tue, Mar 10, 2020 at 04:07:14PM +0100, Oleg Nesterov wrote:
> Annoyingly, this triggers a lot of sparse_error's in pre-process.c:collect_arg().
> And just in case, of course this is not specific to dissect/sindex, ./sparse or
> anything else will equally complain.
>
> For example,
>
> 1011 static inline bool page_expected_state(struct page *page,
> 1012 unsigned long check_flags)
> 1013 {
> 1014 if (unlikely(atomic_read(&page->_mapcount) != -1))
> 1015 return false;
> 1016
> 1017 if (unlikely((unsigned long)page->mapping |
> 1018 page_ref_count(page) |
> 1019 #ifdef CONFIG_MEMCG
> 1020 (unsigned long)page->mem_cgroup |
> 1021 #endif
> 1022 (page->flags & check_flags)))
> 1023 return false;
> 1024
> 1025 return true;
> 1026 }
>
> leads to
>
> mm/page_alloc.c:1019:1: error: directive in macro's argument list
> mm/page_alloc.c:1021:1: error: directive in macro's argument list
This does:
/* Shut up warnings after an error */
has_error |= ERROR_CURR_PHASE;
so we probably end up not seeing some warnings.
>
> and it is not immediately clear why. Yes, because "unlikely" is a macro.
>
> Can't we simply remove this sparse_error() ? "#if" inside the macro's args
> is widely used in kernel, gcc doesn't complain, afaics pre-process.c handles
> this case correctly.
s/correctly/the same as GCC/. The behavior is undefined in c99.
regards,
dan carpenter
next prev parent reply other threads:[~2020-03-11 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 15:25 [PATCH] Add symantic index utility Alexey Gladkov
2020-03-09 22:37 ` Luc Van Oostenryck
2020-03-10 15:07 ` Oleg Nesterov
2020-03-10 17:12 ` Luc Van Oostenryck
2020-03-11 12:04 ` Oleg Nesterov
2020-03-11 16:47 ` Luc Van Oostenryck
2020-03-11 9:07 ` Dan Carpenter [this message]
2020-03-11 11:33 ` Oleg Nesterov
2020-03-11 17:11 ` Luc Van Oostenryck
2020-03-11 17:06 ` Luc Van Oostenryck
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=20200311090745.GD11561@kadam \
--to=dan.carpenter@oracle.com \
--cc=gladkov.alexey@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=oleg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox