From 0cdd2d2c4bfebf5c6a52136cdff2442d3350743e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 27 Nov 2013 14:38:53 -0500 Subject: [PATCH] Cleanup: do not duplicate code in float fix Signed-off-by: Mathieu Desnoyers --- formats/ctf/types/float.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/formats/ctf/types/float.c b/formats/ctf/types/float.c index 030ac167..5fcae004 100644 --- a/formats/ctf/types/float.c +++ b/formats/ctf/types/float.c @@ -200,8 +200,7 @@ int ctf_float_read(struct bt_stream_pos *ppos, struct bt_definition *definition) ctf_init_pos(&destp, NULL, -1, O_RDWR); mmap_align_set_addr(&mma, (char *) u.bits); destp.base_mma = &mma; - destp.packet_size = sizeof(u) * CHAR_BIT; - destp.content_size = sizeof(u) * CHAR_BIT; + destp.content_size = destp.packet_size = sizeof(u) * CHAR_BIT; if (!ctf_align_pos(pos, float_declaration->p.alignment)) { ret = -EFAULT; goto end_unref; @@ -260,8 +259,7 @@ int ctf_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition ctf_init_pos(&srcp, NULL, -1, O_RDONLY); mmap_align_set_addr(&mma, (char *) u.bits); srcp.base_mma = &mma; - srcp.packet_size = sizeof(u) * CHAR_BIT; - srcp.content_size = sizeof(u) * CHAR_BIT; + srcp.content_size = srcp.packet_size = sizeof(u) * CHAR_BIT; switch (float_declaration->mantissa->len + 1) { case FLT_MANT_DIG: u.vf = float_definition->value; -- 2.34.1