[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/7] libvduse: Fix the incorrect function name
From: |
Kevin Wolf |
Subject: |
[PULL 2/7] libvduse: Fix the incorrect function name |
Date: |
Tue, 2 Aug 2022 15:37:52 +0200 |
From: Xie Yongji <xieyongji@bytedance.com>
In vduse_name_is_valid(), we actually check whether
the name is invalid or not. So let's change the
function name to vduse_name_is_invalid() to match
the behavior.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220706095624.328-2-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
subprojects/libvduse/libvduse.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index 9a2bcec282..6374933881 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects/libvduse/libvduse.c
@@ -1193,7 +1193,7 @@ static int vduse_dev_init(VduseDev *dev, const char *name,
return 0;
}
-static inline bool vduse_name_is_valid(const char *name)
+static inline bool vduse_name_is_invalid(const char *name)
{
return strlen(name) >= VDUSE_NAME_MAX || strstr(name, "..");
}
@@ -1242,7 +1242,7 @@ VduseDev *vduse_dev_create_by_name(const char *name,
uint16_t num_queues,
VduseDev *dev;
int ret;
- if (!name || vduse_name_is_valid(name) || !ops ||
+ if (!name || vduse_name_is_invalid(name) || !ops ||
!ops->enable_queue || !ops->disable_queue) {
fprintf(stderr, "Invalid parameter for vduse\n");
return NULL;
@@ -1276,7 +1276,7 @@ VduseDev *vduse_dev_create(const char *name, uint32_t
device_id,
struct vduse_dev_config *dev_config;
size_t size = offsetof(struct vduse_dev_config, config);
- if (!name || vduse_name_is_valid(name) ||
+ if (!name || vduse_name_is_invalid(name) ||
!has_feature(features, VIRTIO_F_VERSION_1) || !config ||
!config_size || !ops || !ops->enable_queue || !ops->disable_queue) {
fprintf(stderr, "Invalid parameter for vduse\n");
--
2.35.3
- [PULL 0/7] Block layer patches, Kevin Wolf, 2022/08/02
- [PULL 4/7] libvduse: Pass positive value to strerror(), Kevin Wolf, 2022/08/02
- [PULL 2/7] libvduse: Fix the incorrect function name,
Kevin Wolf <=
- [PULL 1/7] block/io_uring: add missing include file, Kevin Wolf, 2022/08/02
- [PULL 3/7] libvduse: Replace strcpy() with strncpy(), Kevin Wolf, 2022/08/02
- [PULL 6/7] qemu-iotests: Discard stderr when probing devices, Kevin Wolf, 2022/08/02
- [PULL 7/7] main loop: add missing documentation links to GS/IO macros, Kevin Wolf, 2022/08/02
- [PULL 5/7] hw/block/hd-geometry: Do not override specified bios-chs-trans, Kevin Wolf, 2022/08/02
- Re: [PULL 0/7] Block layer patches, Richard Henderson, 2022/08/02