From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com
Subject: [PATCH liburing v4 1/3] tests/query: get rid of uninit struct warnings
Date: Tue, 14 Oct 2025 16:02:55 +0100 [thread overview]
Message-ID: <6c6df3a32c68feb478787fee1511e67909982cef.1760453798.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1760453798.git.asml.silence@gmail.com>
Compiling with -O0 revealed that compilers are too smart and complain
about io_uring_query_opcode not being initialised. It's not an issue as
it's passed to the kernel to be filled in, nevertheless, let's silence
the warnings.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
test/ring-query.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/ring-query.c b/test/ring-query.c
index 971fd9ba..d0aa396c 100644
--- a/test/ring-query.c
+++ b/test/ring-query.c
@@ -36,7 +36,7 @@ static int io_uring_query(struct io_uring *ring, struct io_uring_query_hdr *arg)
static int test_basic_query(void)
{
- struct io_uring_query_opcode op;
+ struct io_uring_query_opcode op = {};
struct io_uring_query_hdr hdr = {
.query_op = IO_URING_QUERY_OPCODES,
.query_data = uring_ptr_to_u64(&op),
@@ -76,7 +76,7 @@ static int test_basic_query(void)
static int test_invalid(void)
{
int ret;
- struct io_uring_query_opcode op;
+ struct io_uring_query_opcode op = {};
struct io_uring_query_hdr invalid_hdr = {
.query_op = -1U,
.query_data = uring_ptr_to_u64(&op),
@@ -119,7 +119,7 @@ static int test_invalid(void)
static int test_chain(void)
{
int ret;
- struct io_uring_query_opcode op1, op2, op3;
+ struct io_uring_query_opcode op1 = {}, op2 = {}, op3 = {};
struct io_uring_query_hdr hdr3 = {
.query_op = IO_URING_QUERY_OPCODES,
.query_data = uring_ptr_to_u64(&op3),
@@ -163,7 +163,7 @@ static int test_chain(void)
static int test_chain_loop(void)
{
int ret;
- struct io_uring_query_opcode op1, op2;
+ struct io_uring_query_opcode op1 = {}, op2 = {};
struct io_uring_query_hdr hdr2 = {
.query_op = IO_URING_QUERY_OPCODES,
.query_data = uring_ptr_to_u64(&op2),
@@ -201,7 +201,7 @@ static int test_chain_loop(void)
static int test_compatibile_shorter(void)
{
int ret;
- struct io_uring_query_opcode_short op;
+ struct io_uring_query_opcode_short op = {};
struct io_uring_query_hdr hdr = {
.query_op = IO_URING_QUERY_OPCODES,
.query_data = uring_ptr_to_u64(&op),
@@ -234,7 +234,7 @@ static int test_compatibile_shorter(void)
static int test_compatibile_larger(void)
{
int ret;
- struct io_uring_query_opcode_large op;
+ struct io_uring_query_opcode_large op = {};
struct io_uring_query_hdr hdr = {
.query_op = IO_URING_QUERY_OPCODES,
.query_data = uring_ptr_to_u64(&op),
--
2.49.0
next prev parent reply other threads:[~2025-10-14 15:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 15:02 [PATCH liburing v4 0/3] some query related updates Pavel Begunkov
2025-10-14 15:02 ` Pavel Begunkov [this message]
2025-10-14 15:02 ` [PATCH liburing v4 2/3] register: expose a query helper Pavel Begunkov
2025-10-14 15:02 ` [PATCH liburing v4 3/3] test/query: signal query loop Pavel Begunkov
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=6c6df3a32c68feb478787fee1511e67909982cef.1760453798.git.asml.silence@gmail.com \
--to=asml.silence@gmail.com \
--cc=io-uring@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox