summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2018-05-23 22:15:46 +0200
committerKhem Raj <raj.khem@gmail.com>2018-05-26 21:10:55 -0700
commit9f38fa5ae1df01673ad652f6bc92fffe78148ee4 (patch)
tree28e46e054b4e4c024606ec4c55f3ed900c8a52bf /meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch
parentef537dcfef67dd397a82de1c881b76097b5a5554 (diff)
downloadmeta-openembedded-9f38fa5ae1df01673ad652f6bc92fffe78148ee4.tar.gz
ubi-utils-klibc: update from v. 1.5.2 to 2.0.2
Update to new version and drop accepted patches. Use autotools and packageconfig (for xattrs). Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch')
-rw-r--r--meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch44
1 files changed, 0 insertions, 44 deletions
diff --git a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch b/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch
deleted file mode 100644
index 5bd05742c8..0000000000
--- a/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-1.5.2/0008-ubi-utils-ubiformat.c-convert-to-integer-arithmetic.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From e6f1a85c0a3df24fe3ca9a520dc697105e75a80c Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Sat, 27 Jan 2018 09:39:26 +0100
4Subject: [PATCH 8/9] ubi-utils: ubiformat.c: convert to integer arithmetic
5
6Do not cast percent to double, it is just used as upper limit.
7Avoid floating point to fix compilation for aarch64 against klibc:
8
9error: '-mgeneral-regs-only' is incompatible with floating-point code
10| int percent = ((double)si->ok_cnt)/si->good_cnt * 100;
11| ^~~~~~~
12
13Notes:
14* The checks in the code above this line ensure that si->good_cnt is not 0.
15
16* The code assumes si->good_cnt * 100 will not overflow, then we can use
17 (si->ok_cnt * 100) safely because the former is bigger.
18
19* The truncated result does not affect the logic:
20 i.e. a value of 49.9 is truncated to 49 and is still <50.
21
22Upstream-Status: Submitted
23
24Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
25---
26 ubi-utils/ubiformat.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
30index 21409ca..d93164a 100644
31--- a/ubi-utils/ubiformat.c
32+++ b/ubi-utils/ubiformat.c
33@@ -843,7 +843,7 @@ int main(int argc, char * const argv[])
34 }
35
36 if (!args.override_ec && si->empty_cnt < si->good_cnt) {
37- int percent = ((double)si->ok_cnt)/si->good_cnt * 100;
38+ int percent = (si->ok_cnt * 100) / si->good_cnt;
39
40 /*
41 * Make sure the majority of eraseblocks have valid
42--
432.7.4
44