From: Kent Overstreet <kent.overstreet@linux.dev>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>,
Kent Overstreet <kent.overstreet@linux.dev>,
brauner@kernel.org, viro@zeniv.linux.org.uk,
Bernd Schubert <bernd.schubert@fastmail.fm>,
linux-mm@kvack.org, Josef Bacik <josef@toxicpanda.com>
Subject: [PATCH 2/5] darray: Fix darray_for_each_reverse() when darray is empty
Date: Sun, 2 Jun 2024 20:32:59 -0400 [thread overview]
Message-ID: <20240603003306.2030491-3-kent.overstreet@linux.dev> (raw)
In-Reply-To: <20240603003306.2030491-1-kent.overstreet@linux.dev>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
include/linux/darray.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/darray.h b/include/linux/darray.h
index ff167eb795f2..603d6762c29a 100644
--- a/include/linux/darray.h
+++ b/include/linux/darray.h
@@ -108,7 +108,7 @@ do { \
for (typeof(&(_d).data[0]) _i = (_d).data; _i < (_d).data + (_d).nr; _i++)
#define darray_for_each_reverse(_d, _i) \
- for (typeof(&(_d).data[0]) _i = (_d).data + (_d).nr - 1; _i >= (_d).data; --_i)
+ for (typeof(&(_d).data[0]) _i = (_d).data + (_d).nr - 1; (_d).data && _i >= (_d).data; --_i)
#define darray_init(_d) \
do { \
--
2.45.1
next prev parent reply other threads:[~2024-06-03 0:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 0:32 [PATCH 0/5] sys_ringbuffer Kent Overstreet
2024-06-03 0:32 ` [PATCH 1/5] darray: lift from bcachefs Kent Overstreet
2024-06-03 0:32 ` Kent Overstreet [this message]
2024-06-03 0:33 ` [PATCH 3/5] fs: sys_ringbuffer Kent Overstreet
2024-06-03 4:16 ` kernel test robot
2024-06-03 4:38 ` kernel test robot
2024-06-23 22:13 ` Thomas Gleixner
2024-06-23 22:21 ` Kent Overstreet
2024-06-23 23:16 ` Thomas Gleixner
2024-06-24 0:27 ` Kent Overstreet
2024-06-03 0:33 ` [PATCH 4/5] ringbuffer: Test device Kent Overstreet
2024-06-03 0:33 ` [PATCH 5/5] ringbuffer: Userspace test helper Kent Overstreet
2024-06-07 1:49 ` [PATCH 0/5] sys_ringbuffer Stefan Hajnoczi
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=20240603003306.2030491-3-kent.overstreet@linux.dev \
--to=kent.overstreet@linux.dev \
--cc=axboe@kernel.dk \
--cc=bernd.schubert@fastmail.fm \
--cc=brauner@kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=viro@zeniv.linux.org.uk \
/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).