summaryrefslogtreecommitdiff
path: root/util-linux/volume_id/util.c
diff options
context:
space:
mode:
authorSven-Göran Bergh2013-01-14 00:50:49 +0100
committerDenys Vlasenko2013-01-14 00:52:03 +0100
commit52185155088d0910d29c7f4fdf5cb3eecaac8965 (patch)
treec09709e352e3431a0eddb12d5acc7a5c5a7aac63 /util-linux/volume_id/util.c
parent07b419dbcb34958d0f6050231783bd78f7d0344f (diff)
downloadbusybox-52185155088d0910d29c7f4fdf5cb3eecaac8965.zip
busybox-52185155088d0910d29c7f4fdf5cb3eecaac8965.tar.gz
volume_id: uuid_format small code shrink
function old new delta volume_id_set_uuid 318 300 -18 Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/volume_id/util.c')
-rw-r--r--util-linux/volume_id/util.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/util-linux/volume_id/util.c b/util-linux/volume_id/util.c
index 11ee0d5..0e2d24b 100644
--- a/util-linux/volume_id/util.c
+++ b/util-linux/volume_id/util.c
@@ -135,23 +135,8 @@ void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enu
void volume_id_set_uuid(struct volume_id *id, const uint8_t *buf, enum uuid_format format)
{
unsigned i;
- unsigned count = 0;
+ unsigned count = (format == UUID_DCE_STRING ? VOLUME_ID_UUID_SIZE : 4 << format);
- switch (format) {
- case UUID_DOS:
- count = 4;
- break;
- case UUID_NTFS:
- count = 8;
- break;
- case UUID_DCE:
- count = 16;
- break;
- case UUID_DCE_STRING:
- /* 36 is ok, id->uuid has one extra byte for NUL */
- count = VOLUME_ID_UUID_SIZE;
- break;
- }
// memcpy(id->uuid_raw, buf, count);
// id->uuid_raw_len = count;