From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: linux-sparse@vger.kernel.org,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH v4 4/5] ptrlist: avoid iteration on NULL entries
Date: Sat, 5 Aug 2017 00:17:41 +0200 [thread overview]
Message-ID: <20170804221742.66665-5-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170804221742.66665-1-luc.vanoostenryck@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
ptrlist.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ptrlist.h b/ptrlist.h
index 74b80e220..1839b0f46 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -162,6 +162,8 @@ static inline void *last_ptr_list(struct ptr_list *list)
for (__nr = 0; __nr < __list->nr; __nr++) { \
do { \
ptr = PTR_ENTRY(__list,__nr); \
+ if (list->rm && !ptr) \
+ continue; \
do {
#define DO_END_FOR_EACH(ptr, __head, __list, __nr) \
@@ -183,6 +185,8 @@ static inline void *last_ptr_list(struct ptr_list *list)
while (--__nr >= 0) { \
do { \
ptr = PTR_ENTRY(__list,__nr); \
+ if (list->rm && !ptr) \
+ continue; \
do {
--
2.13.2
next prev parent reply other threads:[~2017-08-04 22:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 22:17 [PATCH v3 0/5] fix list corruption with recursive remove_usage() Luc Van Oostenryck
2017-08-04 22:17 ` [PATCH v4 1/5] ptrlist: add a counter for the number of removed elemnets Luc Van Oostenryck
2017-08-04 22:17 ` [PATCH v4 2/5] ptrlist: adjust ptr_list_size for the new ->rm field Luc Van Oostenryck
2017-08-04 22:17 ` [PATCH v4 3/5] ptrlist: add MARK_CURRENT_DELETED Luc Van Oostenryck
2017-08-04 22:17 ` Luc Van Oostenryck [this message]
2017-08-04 22:17 ` [PATCH v4 5/5] mark pseudo users as deleted instead of removing them 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=20170804221742.66665-5-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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).