diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-08-16 20:06:07 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-08-23 14:37:21 +0200 |
commit | ff86c6ed00859a93b984ffd5944c6ba3e450c747 (patch) | |
tree | f806c11edacd3a08a646469a97408a3ad07e832d /libdm/ioctl/libdm-iface.c | |
parent | ba309e0da5bd22f844dbfc284c1606ca413f79f7 (diff) | |
download | lvm2-ff86c6ed00859a93b984ffd5944c6ba3e450c747.tar.gz lvm2-ff86c6ed00859a93b984ffd5944c6ba3e450c747.tar.xz lvm2-ff86c6ed00859a93b984ffd5944c6ba3e450c747.zip |
cleanup: keep MKNOD type cast clean
Setup major already a dev_t type before it gets shifted.
Diffstat (limited to 'libdm/ioctl/libdm-iface.c')
-rw-r--r-- | libdm/ioctl/libdm-iface.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index 5276c113..9932aa9c 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -239,7 +239,7 @@ static int _control_exists(const char *control, uint32_t major, uint32_t minor) return -1; } - if (major && buf.st_rdev != MKDEV(major, minor)) { + if (major && buf.st_rdev != MKDEV((dev_t)major, minor)) { log_verbose("%s: Wrong device number: (%u, %u) instead of " "(%u, %u)", control, MAJOR(buf.st_mode), MINOR(buf.st_mode), @@ -282,7 +282,7 @@ static int _create_control(const char *control, uint32_t major, uint32_t minor) (void) dm_prepare_selinux_context(control, S_IFCHR); old_umask = umask(DM_CONTROL_NODE_UMASK); if (mknod(control, S_IFCHR | S_IRUSR | S_IWUSR, - MKDEV(major, minor)) < 0) { + MKDEV((dev_t)major, minor)) < 0) { log_sys_error("mknod", control); (void) dm_prepare_selinux_context(NULL, 0); return 0; @@ -1062,7 +1062,7 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count) } dmi->flags |= DM_PERSISTENT_DEV_FLAG; - dmi->dev = MKDEV(dmt->major, dmt->minor); + dmi->dev = MKDEV((dev_t)dmt->major, dmt->minor); } /* Does driver support device number referencing? */ |