diff options
author | John Levon <john.levon@nutanix.com> | 2021-02-18 16:01:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 16:01:21 +0000 |
commit | c4f6f81007cf6ab720067d8f8e9288c5dfd5a720 (patch) | |
tree | b407c1b6355b8d3646a4f75ccd04f6610d4ae0b3 /samples/server.c | |
parent | 22a80ef616beaf7ac495698a4219f37efe5635c8 (diff) | |
download | libvfio-user-c4f6f81007cf6ab720067d8f8e9288c5dfd5a720.zip libvfio-user-c4f6f81007cf6ab720067d8f8e9288c5dfd5a720.tar.gz libvfio-user-c4f6f81007cf6ab720067d8f8e9288c5dfd5a720.tar.bz2 |
use sizeof() consistently (#351)
The most common way we have written this is as "sizeof()"; use this form
consistently.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/server.c')
-rw-r--r-- | samples/server.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/server.c b/samples/server.c index 72d4241..4391bca 100644 --- a/samples/server.c +++ b/samples/server.c @@ -346,7 +346,7 @@ migration_read_data(vfu_ctx_t *vfu_ctx, void *buf, __u64 size, __u64 offset) memcpy(buf, server_data->bar1, server_data->bar1_size); if (server_data->migration.state == VFU_MIGR_STATE_STOP_AND_COPY) { memcpy(buf + server_data->bar1_size, &server_data->bar0, - sizeof server_data->bar0); + sizeof(server_data->bar0)); } server_data->migration.pending_bytes = 0; @@ -376,12 +376,12 @@ migration_write_data(vfu_ctx_t *vfu_ctx, void *data, __u64 size, __u64 offset) if (size == 0) { return 0; } - if (size != sizeof server_data->bar0) { + if (size != sizeof(server_data->bar0)) { errno = EINVAL; return -1; } - memcpy(&server_data->bar0, buf, sizeof server_data->bar0); - ret = bar0_access(vfu_ctx, buf, sizeof server_data->bar0, 0, true); + memcpy(&server_data->bar0, buf, sizeof(server_data->bar0)); + ret = bar0_access(vfu_ctx, buf, sizeof(server_data->bar0), 0, true); assert(ret == (int)size); /* FIXME */ return 0; |