[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 10/29] vvfat: use DIV_ROUND_UP
From: |
Marc-André Lureau |
Subject: |
[Qemu-trivial] [PULL 10/29] vvfat: use DIV_ROUND_UP |
Date: |
Thu, 31 Aug 2017 12:34:13 +0200 |
I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
block/vvfat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index a9e207f7f0..c54fa94651 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -449,7 +449,7 @@ static direntry_t *create_long_filename(BDRVVVFATState *s,
const char *filename)
return NULL;
}
- number_of_entries = (length * 2 + 25) / 26;
+ number_of_entries = DIV_ROUND_UP(length * 2, 26);
for(i=0;i<number_of_entries;i++) {
entry=array_get_next(&(s->directory));
@@ -2554,7 +2554,7 @@ static int commit_one_file(BDRVVVFATState* s,
(size > offset && c >=2 && !fat_eof(s, c)));
ret = vvfat_read(s->bs, cluster2sector(s, c),
- (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
+ (uint8_t*)cluster, DIV_ROUND_UP(rest_size, 0x200));
if (ret < 0) {
qemu_close(fd);
--
2.14.1.146.gd35faa819
- [Qemu-trivial] [PULL 00/29] Code cleanup patches, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 01/29] i386: use ROUND_UP macro, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 02/29] vnc: use QEMU_ALIGN_DOWN, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 03/29] vhdx: use QEMU_ALIGN_DOWN, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 04/29] vhost: use QEMU_ALIGN_DOWN, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 05/29] i8254: use QEMU_ALIGN_DOWN, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 06/29] pcspk: use QEMU_ALIGN_DOWN, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 07/29] dmg: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 10/29] vvfat: use DIV_ROUND_UP,
Marc-André Lureau <=
- [Qemu-trivial] [PULL 08/29] qcow2: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 11/29] vnc: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 09/29] vpc: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 12/29] ui: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 13/29] vga: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 14/29] virtio-gpu: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 15/29] monitor: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 16/29] console: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 17/29] virtio-serial: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31
- [Qemu-trivial] [PULL 18/29] piix: use DIV_ROUND_UP, Marc-André Lureau, 2017/08/31