]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/parisc-fix-compiler-warnings-in-float-emulation-code.patch
fixes for 4.4
[thirdparty/kernel/stable-queue.git] / queue-4.4 / parisc-fix-compiler-warnings-in-float-emulation-code.patch
1 From 775c24b68bc41ba95cbb665ab7c5cf9ce53c8602 Mon Sep 17 00:00:00 2001
2 From: Helge Deller <deller@gmx.de>
3 Date: Fri, 24 May 2019 23:16:25 +0200
4 Subject: parisc: Fix compiler warnings in float emulation code
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit 6b98d9134e14f5ef4bcf64b27eedf484ed19a1ec ]
10
11 Avoid such compiler warnings:
12 arch/parisc/math-emu/cnv_float.h:71:27: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
13 ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
14 arch/parisc/math-emu/fcnvxf.c:257:6: note: in expansion of macro ‘Dint_isinexact_to_sgl’
15 if (Dint_isinexact_to_sgl(srcp1,srcp2)) {
16
17 Signed-off-by: Helge Deller <deller@gmx.de>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 arch/parisc/math-emu/cnv_float.h | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
22
23 diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h
24 index 933423fa5144..b0db61188a61 100644
25 --- a/arch/parisc/math-emu/cnv_float.h
26 +++ b/arch/parisc/math-emu/cnv_float.h
27 @@ -60,19 +60,19 @@
28 ((exponent < (SGL_P - 1)) ? \
29 (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)
30
31 -#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH)
32 +#define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0)
33
34 #define Sgl_roundnearest_from_int(int_value,sgl_value) \
35 if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
36 - if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \
37 + if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
38 Sall(sgl_value)++
39
40 #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \
41 - ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
42 + (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
43
44 #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \
45 if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
46 - if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \
47 + if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \
48 Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++
49
50 #define Dint_isinexact_to_dbl(dint_value) \
51 --
52 2.20.1
53