public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ringtest: fix an assert statement
@ 2017-04-15 19:22 Dan Carpenter
  2017-04-18  3:01 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-04-15 19:22 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Paolo Bonzini, kernel-janitors, virtualization

There is an || vs && typo so the assert can never be triggered.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/tools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c
index 022ae95a06bd..453ca3c21193 100644
--- a/tools/virtio/ringtest/main.c
+++ b/tools/virtio/ringtest/main.c
@@ -87,7 +87,7 @@ void set_affinity(const char *arg)
 	cpu = strtol(arg, &endptr, 0);
 	assert(!*endptr);
 
-	assert(cpu >= 0 || cpu < CPU_SETSIZE);
+	assert(cpu >= 0 && cpu < CPU_SETSIZE);
 
 	self = pthread_self();
 	CPU_ZERO(&cpuset);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ringtest: fix an assert statement
  2017-04-15 19:22 [PATCH] ringtest: fix an assert statement Dan Carpenter
@ 2017-04-18  3:01 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2017-04-18  3:01 UTC (permalink / raw)
  To: kernel-janitors



On 2017年04月16日 03:22, Dan Carpenter wrote:
> There is an || vs && typo so the assert can never be triggered.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/tools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c
> index 022ae95a06bd..453ca3c21193 100644
> --- a/tools/virtio/ringtest/main.c
> +++ b/tools/virtio/ringtest/main.c
> @@ -87,7 +87,7 @@ void set_affinity(const char *arg)
>   	cpu = strtol(arg, &endptr, 0);
>   	assert(!*endptr);
>   
> -	assert(cpu >= 0 || cpu < CPU_SETSIZE);
> +	assert(cpu >= 0 && cpu < CPU_SETSIZE);
>   
>   	self = pthread_self();
>   	CPU_ZERO(&cpuset);

Acked-by: Jason Wang <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-18  3:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-15 19:22 [PATCH] ringtest: fix an assert statement Dan Carpenter
2017-04-18  3:01 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox