mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Rong Tao <rtoax@foxmail.com>
Cc: mst@redhat.com, Rong Tao <rongtao@cestc.cn>,
	Jason Wang <jasowang@redhat.com>,
	"open list:VIRTIO CORE AND NET DRIVERS" 
	<virtualization@lists.linux-foundation.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/virtio: virtio_test -h,--help should return directly
Date: Wed, 8 Mar 2023 15:17:37 +0100	[thread overview]
Message-ID: <20230308141737.ioxvifnarhluafmh@sgarzare-redhat> (raw)
In-Reply-To: <tencent_A95EA946D511450DBE8486B2122FA1549609@qq.com>

On Fri, Feb 24, 2023 at 10:30:30PM +0800, Rong Tao wrote:
>From: Rong Tao <rongtao@cestc.cn>
>
>When we get help information, we should return directly, and we should not
>execute test cases. At the same time, the code indentation issue was fixed
>and virtio-trace/trace-agent was added to .gitignore.

Thanks for this cleanup, but you mentioned 3 independent things that
this patch does, so it would be better to split it into 3 separate
patches.

>
>Signed-off-by: Rong Tao <rongtao@cestc.cn>
>---
> tools/virtio/.gitignore    | 1 +
> tools/virtio/virtio_test.c | 6 +++---
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/tools/virtio/.gitignore b/tools/virtio/.gitignore
>index 075588c4da08..9934d48d9a55 100644
>--- a/tools/virtio/.gitignore
>+++ b/tools/virtio/.gitignore
>@@ -2,3 +2,4 @@
> *.d
> virtio_test
> vringh_test
>+virtio-trace/trace-agent
>diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
>index 120062f94590..6370cdada396 100644
>--- a/tools/virtio/virtio_test.c
>+++ b/tools/virtio/virtio_test.c
>@@ -134,7 +134,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
> 	dev->buf_size = 1024;
> 	dev->buf = malloc(dev->buf_size);
> 	assert(dev->buf);
>-        dev->control = open("/dev/vhost-test", O_RDWR);
>+	dev->control = open("/dev/vhost-test", O_RDWR);
> 	assert(dev->control >= 0);
> 	r = ioctl(dev->control, VHOST_SET_OWNER, NULL);
> 	assert(r >= 0);
>@@ -142,7 +142,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
> 			  sizeof dev->mem->regions[0]);
> 	assert(dev->mem);
> 	memset(dev->mem, 0, offsetof(struct vhost_memory, regions) +
>-                          sizeof dev->mem->regions[0]);
>+			sizeof dev->mem->regions[0]);

This did not seem to me to be an indentation issue, there are 2 tabs and
1 space to line it up with the opening of the parenthesis of the line
above.

> 	dev->mem->nregions = 1;
> 	dev->mem->regions[0].guest_phys_addr = (long)dev->buf;
> 	dev->mem->regions[0].userspace_addr = (long)dev->buf;
>@@ -361,7 +361,7 @@ int main(int argc, char **argv)
> 			break;
> 		case 'h':
> 			help();
>-			goto done;
>+			exit(0);

Maybe we can move the exit() directly into the help() function and 
remove it from case '?'.

I would return a value different from 0 (like in the case '?').

Thanks,
Stefano

> 		case 'i':
> 			features &= ~(1ULL << VIRTIO_RING_F_INDIRECT_DESC);
> 			break;
>-- 
>2.39.2
>


  reply	other threads:[~2023-03-08 14:18 UTC|newest]

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

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