[PATCH] block/sheepdog: Replace magic val by NANOSECONDS_PER_SECOND definition

Philippe Mathieu-Daudé posted 1 patch 5 years, 1 month ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200921110145.520944-1-philmd@redhat.com
block/sheepdog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] block/sheepdog: Replace magic val by NANOSECONDS_PER_SECOND definition
Posted by Philippe Mathieu-Daudé 5 years, 1 month ago
Use self-explicit NANOSECONDS_PER_SECOND definition instead
of magic value.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 block/sheepdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index cbbebc1aaf2..cbc655a1a05 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -740,7 +740,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque)
         if (s->fd < 0) {
             trace_sheepdog_reconnect_to_sdog();
             error_report_err(local_err);
-            qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, 1000000000ULL);
+            qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, NANOSECONDS_PER_SECOND);
         }
     };
 
-- 
2.26.2

Re: [PATCH] block/sheepdog: Replace magic val by NANOSECONDS_PER_SECOND definition
Posted by Alberto Garcia 5 years, 1 month ago
On Mon 21 Sep 2020 01:01:45 PM CEST, Philippe Mathieu-Daudé wrote:
> Use self-explicit NANOSECONDS_PER_SECOND definition instead
> of magic value.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

Re: [PATCH] block/sheepdog: Replace magic val by NANOSECONDS_PER_SECOND definition
Posted by Kevin Wolf 5 years, 1 month ago
Am 21.09.2020 um 13:01 hat Philippe Mathieu-Daudé geschrieben:
> Use self-explicit NANOSECONDS_PER_SECOND definition instead
> of magic value.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Thanks, applied to the block branch.

Kevin