]> git.baikalelectronics.ru Git - kernel.git/commitdiff
MIPS: math-emu: Avoid multiple assignment
authorAleksandar Markovic <aleksandar.markovic@mips.com>
Thu, 2 Nov 2017 11:14:04 +0000 (12:14 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 12 Dec 2017 16:20:20 +0000 (17:20 +0100)
Replace several instances of multiple assignment with individual
assignments.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Cc: Douglas Leung <douglas.leung@mips.com>
Cc: Goran Ferenc <goran.ferenc@mips.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Maciej W. Rozycki <macro@mips.com>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Miodrag Dinic <miodrag.dinic@mips.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Petar Jovanovic <petar.jovanovic@mips.com>
Cc: Raghu Gandham <raghu.gandham@mips.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17587/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/dp_sqrt.c
arch/mips/math-emu/sp_sqrt.c

index 9e5c8806e43a24a546786d328681364214f6a311..fe74973a0a29d56749a451fc5f71ec2b6bc415a3 100644 (file)
@@ -1190,7 +1190,8 @@ emul:
                        if (!cpu_has_mips_r6 || delay_slot(xcp))
                                return SIGILL;
 
-                       cond = likely = 0;
+                       likely = 0;
+                       cond = 0;
                        fpr = &current->thread.fpu.fpr[MIPSInst_RT(ir)];
                        bit0 = get_fpr32(fpr, 0) & 0x1;
                        switch (MIPSInst_RS(ir)) {
index cea907b83146018486c6910d9c2c39319d2fca10..fa39eb84ba8bfccdecd57600ea729f6c5cda2f19 100644 (file)
@@ -91,7 +91,8 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
                scalx -= 256;
        }
 
-       y = x = builddp(0, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT);
+       x = builddp(0, xe + DP_EBIAS, xm & ~DP_HIDDEN_BIT);
+       y = x;
 
        /* magic initial approximation to almost 8 sig. bits */
        yh = y.bits >> 32;
@@ -108,7 +109,8 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
 
        /* triple to almost 56 sig. bits: y ~= sqrt(x) to within 1 ulp */
        /* t=y*y; z=t;  pt[n0]+=0x00100000; t+=z; z=(x-z)*y; */
-       z = t = ieee754dp_mul(y, y);
+       t = ieee754dp_mul(y, y);
+       z = t;
        t.bexp += 0x001;
        t = ieee754dp_add(t, z);
        z = ieee754dp_mul(ieee754dp_sub(x, z), y);
index 67059c33a250a9e45bcdb4c18e84ad295fb9de6a..9cc83f012342ceea6cffdd70b7050152ff4ec854 100644 (file)
@@ -82,7 +82,8 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
 
        /* generate sqrt(x) bit by bit */
        ix += ix;
-       q = s = 0;              /* q = sqrt(x) */
+       s = 0;
+       q = 0;                  /* q = sqrt(x) */
        r = 0x01000000;         /* r = moving bit from right to left */
 
        while (r != 0) {