mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rong Tao <rtoax@foxmail.com>
To: sgarzare@redhat.com, mst@redhat.com
Cc: Rong Tao <rongtao@cestc.cn>, Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org (open list:VIRTIO CORE
	AND NET DRIVERS), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] tools/virtio: virtio_test -h,--help should return directly
Date: Thu,  9 Mar 2023 14:13:13 +0800	[thread overview]
Message-ID: <tencent_4B5122C4158323A1D1ACA04B3295F1579207@qq.com> (raw)

From: Rong Tao <rongtao@cestc.cn>

When we get help information, we should return directly, and we should not
execute test cases. Move the exit() directly into the help() function and
remove it from case '?'.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
---
 tools/virtio/virtio_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 120062f94590..6e348fbdc5d8 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -337,6 +337,8 @@ static void help(void)
 		" [--batch=random/N]"
 		" [--reset=N]"
 		"\n");
+
+	exit(0);
 }
 
 int main(int argc, char **argv)
@@ -354,14 +356,12 @@ int main(int argc, char **argv)
 		case -1:
 			goto done;
 		case '?':
-			help();
 			exit(2);
 		case 'e':
 			features &= ~(1ULL << VIRTIO_RING_F_EVENT_IDX);
 			break;
 		case 'h':
 			help();
-			goto done;
 		case 'i':
 			features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC);
 			break;
-- 
2.39.1


             reply	other threads:[~2023-03-09  6:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  6:13 Rong Tao [this message]
2023-03-09  8:31 ` Stefano Garzarella
  -- strict thread matches above, loose matches on Subject: below --
2023-03-09  8:49 [PATCH v2] " Stefano Garzarella
2023-03-09  8:56 ` [PATCH] " Rong Tao
2023-03-09  9:08   ` Stefano Garzarella
2023-02-24 14:30 Rong Tao
2023-03-08 14:17 ` Stefano Garzarella
2023-03-09  6:17   ` Rong Tao

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=tencent_4B5122C4158323A1D1ACA04B3295F1579207@qq.com \
    --to=rtoax@foxmail.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=rongtao@cestc.cn \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux-foundation.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®