mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dirk Gouders <dirk@gouders.net>
To: Shuah Khan <shuah@kernel.org>
Cc: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-kselftest@vger.kernel.org, linux-block@vger.kernel.org,
	Dirk Gouders <dirk@gouders.net>
Subject: [PATCH] selftests: ublk: fix unused_result error
Date: Mon, 14 Sep 2026 13:01:09 +0200	[thread overview]
Message-ID: <20260914110145.41627-2-dirk@gouders.net> (raw)

Commit 166b476b8dee (selftests/ublk: add shared memory zero-copy
support in kublk, 2026-03-31) introduced a write(2), ignoring its
return value and thus causing an error, when building.

Fix this by using the common workaround "(void)!" to trick the
compiler the result is being used.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
---
 tools/testing/selftests/ublk/kublk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c
index 2400b4615766..5b19bfcfa8d7 100644
--- a/tools/testing/selftests/ublk/kublk.c
+++ b/tools/testing/selftests/ublk/kublk.c
@@ -1589,7 +1589,7 @@ static int ublk_start_daemon(const struct dev_ctx *ctx, struct ublk_dev *dev)
 
 	/* Signal listener thread to stop and wait for it */
 	if (linfo.stop_efd >= 0) {
-		write(linfo.stop_efd, &stop_val, sizeof(stop_val));
+		(void)!write(linfo.stop_efd, &stop_val, sizeof(stop_val));
 		pthread_join(listener, NULL);
 		close(linfo.stop_efd);
 		ublk_shmem_sock_destroy(dinfo->dev_id, linfo.sock_fd);
-- 
2.55.0


             reply	other threads:[~2026-09-14 11:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 11:01 Dirk Gouders [this message]
2026-09-20 13:44 ` Ming Lei
2026-09-21 16:32 ` Jens Axboe

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=20260914110145.41627-2-dirk@gouders.net \
    --to=dirk@gouders.net \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shuah@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

all inboxes | Powered by JetHome®