Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: math-emu: Use preferred flavor of unsigned integer declarations

Fix occurences of unsigned integer variable declarations that are
not preferred by standards of checkpatch scripts. This removes a
significant number of checkpatch warnings for files in math-emu
directory (several files become completely warning-free), and thus
makes easier to spot (now and in the future) other, perhaps more
significant, checkpatch errors and warnings.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Reviewed-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Douglas Leung <douglas.leung@mips.com>
Cc: Goran Ferenc <goran.ferenc@mips.com>
Cc: "Maciej W. Rozycki" <macro@imgtec.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
Patchwork: https://patchwork.linux-mips.org/patch/17582/
Signed-off-by: James Hogan <jhogan@kernel.org>

authored by

Aleksandar Markovic and committed by
James Hogan
a58f85b5 409fcace

+45 -42
+10 -8
arch/mips/math-emu/cp1emu.c
··· 810 810 #define SITOREG(si, x) \ 811 811 do { \ 812 812 if (cop1_64bit(xcp) && !hybrid_fprs()) { \ 813 - unsigned i; \ 813 + unsigned int i; \ 814 814 set_fpr32(&ctx->fpr[x], 0, si); \ 815 815 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \ 816 816 set_fpr32(&ctx->fpr[x], i, 0); \ ··· 823 823 824 824 #define SITOHREG(si, x) \ 825 825 do { \ 826 - unsigned i; \ 826 + unsigned int i; \ 827 827 set_fpr32(&ctx->fpr[x], 1, si); \ 828 828 for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \ 829 829 set_fpr32(&ctx->fpr[x], i, 0); \ ··· 834 834 835 835 #define DITOREG(di, x) \ 836 836 do { \ 837 - unsigned fpr, i; \ 837 + unsigned int fpr, i; \ 838 838 fpr = (x) & ~(cop1_64bit(xcp) ^ 1); \ 839 839 set_fpr64(&ctx->fpr[fpr], 0, di); \ 840 840 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++) \ ··· 1465 1465 static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, 1466 1466 mips_instruction ir, void __user **fault_addr) 1467 1467 { 1468 - unsigned rcsr = 0; /* resulting csr */ 1468 + unsigned int rcsr = 0; /* resulting csr */ 1469 1469 1470 1470 MIPS_FPU_EMU_INC_STATS(cp1xops); 1471 1471 ··· 1661 1661 mips_instruction ir) 1662 1662 { 1663 1663 int rfmt; /* resulting format */ 1664 - unsigned rcsr = 0; /* resulting csr */ 1664 + unsigned int rcsr = 0; /* resulting csr */ 1665 1665 unsigned int oldrm; 1666 1666 unsigned int cbit; 1667 - unsigned cond; 1667 + unsigned int cond; 1668 1668 union { 1669 1669 union ieee754dp d; 1670 1670 union ieee754sp s; ··· 2029 2029 2030 2030 default: 2031 2031 if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) { 2032 - unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2032 + unsigned int cmpop; 2033 2033 union ieee754sp fs, ft; 2034 2034 2035 + cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2035 2036 SPFROMREG(fs, MIPSInst_FS(ir)); 2036 2037 SPFROMREG(ft, MIPSInst_FT(ir)); 2037 2038 rv.w = ieee754sp_cmp(fs, ft, ··· 2380 2379 2381 2380 default: 2382 2381 if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) { 2383 - unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2382 + unsigned int cmpop; 2384 2383 union ieee754dp fs, ft; 2385 2384 2385 + cmpop = MIPSInst_FUNC(ir) - fcmp_op; 2386 2386 DPFROMREG(fs, MIPSInst_FS(ir)); 2387 2387 DPFROMREG(ft, MIPSInst_FT(ir)); 2388 2388 rv.w = ieee754dp_cmp(fs, ft,
+4 -4
arch/mips/math-emu/dp_maddf.c
··· 45 45 { 46 46 int re; 47 47 int rs; 48 - unsigned lxm; 49 - unsigned hxm; 50 - unsigned lym; 51 - unsigned hym; 48 + unsigned int lxm; 49 + unsigned int hxm; 50 + unsigned int lym; 51 + unsigned int hym; 52 52 u64 lrm; 53 53 u64 hrm; 54 54 u64 lzm;
+4 -4
arch/mips/math-emu/dp_mul.c
··· 26 26 int re; 27 27 int rs; 28 28 u64 rm; 29 - unsigned lxm; 30 - unsigned hxm; 31 - unsigned lym; 32 - unsigned hym; 29 + unsigned int lxm; 30 + unsigned int hxm; 31 + unsigned int lym; 32 + unsigned int hym; 33 33 u64 lrm; 34 34 u64 hrm; 35 35 u64 t;
+2 -2
arch/mips/math-emu/dp_sqrt.c
··· 21 21 22 22 #include "ieee754dp.h" 23 23 24 - static const unsigned table[] = { 24 + static const unsigned int table[] = { 25 25 0, 1204, 3062, 5746, 9193, 13348, 18162, 23592, 26 26 29598, 36145, 43202, 50740, 58733, 67158, 75992, 27 27 85215, 83599, 71378, 60428, 50647, 41945, 34246, ··· 33 33 { 34 34 struct _ieee754_csr oldcsr; 35 35 union ieee754dp y, z, t; 36 - unsigned scalx, yh; 36 + unsigned int scalx, yh; 37 37 COMPXDP; 38 38 39 39 EXPLODEXDP;
+8 -7
arch/mips/math-emu/ieee754.h
··· 165 165 }; 166 166 #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31)) 167 167 168 - static inline unsigned ieee754_getrm(void) 168 + static inline unsigned int ieee754_getrm(void) 169 169 { 170 170 return (ieee754_csr.rm); 171 171 } 172 - static inline unsigned ieee754_setrm(unsigned rm) 172 + 173 + static inline unsigned int ieee754_setrm(unsigned int rm) 173 174 { 174 175 return (ieee754_csr.rm = rm); 175 176 } ··· 178 177 /* 179 178 * get current exceptions 180 179 */ 181 - static inline unsigned ieee754_getcx(void) 180 + static inline unsigned int ieee754_getcx(void) 182 181 { 183 182 return (ieee754_csr.cx); 184 183 } 185 184 186 185 /* test for current exception condition 187 186 */ 188 - static inline int ieee754_cxtest(unsigned n) 187 + static inline int ieee754_cxtest(unsigned int n) 189 188 { 190 189 return (ieee754_csr.cx & n); 191 190 } ··· 193 192 /* 194 193 * get sticky exceptions 195 194 */ 196 - static inline unsigned ieee754_getsx(void) 195 + static inline unsigned int ieee754_getsx(void) 197 196 { 198 197 return (ieee754_csr.sx); 199 198 } 200 199 201 200 /* clear sticky conditions 202 201 */ 203 - static inline unsigned ieee754_clrsx(void) 202 + static inline unsigned int ieee754_clrsx(void) 204 203 { 205 204 return (ieee754_csr.sx = 0); 206 205 } 207 206 208 207 /* test for sticky exception condition 209 208 */ 210 - static inline int ieee754_sxtest(unsigned n) 209 + static inline int ieee754_sxtest(unsigned int n) 211 210 { 212 211 return (ieee754_csr.sx & n); 213 212 }
+3 -3
arch/mips/math-emu/ieee754int.h
··· 54 54 } 55 55 56 56 #define COMPXSP \ 57 - unsigned xm; int xe; int xs __maybe_unused; int xc 57 + unsigned int xm; int xe; int xs __maybe_unused; int xc 58 58 59 59 #define COMPYSP \ 60 - unsigned ym; int ye; int ys; int yc 60 + unsigned int ym; int ye; int ys; int yc 61 61 62 62 #define COMPZSP \ 63 - unsigned zm; int ze; int zs; int zc 63 + unsigned int zm; int ze; int zs; int zc 64 64 65 65 #define EXPLODESP(v, vc, vs, ve, vm) \ 66 66 { \
+2 -2
arch/mips/math-emu/ieee754sp.c
··· 65 65 return r; 66 66 } 67 67 68 - static unsigned ieee754sp_get_rounding(int sn, unsigned xm) 68 + static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm) 69 69 { 70 70 /* inexact must round of 3 bits 71 71 */ ··· 96 96 * xe is an unbiased exponent 97 97 * xm is 3bit extended precision value. 98 98 */ 99 - union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) 99 + union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm) 100 100 { 101 101 assert(xm); /* we don't gen exact zeros (probably should) */ 102 102
+1 -1
arch/mips/math-emu/ieee754sp.h
··· 69 69 #define SPDNORMY SPDNORMx(ym, ye) 70 70 #define SPDNORMZ SPDNORMx(zm, ze) 71 71 72 - static inline union ieee754sp buildsp(int s, int bx, unsigned m) 72 + static inline union ieee754sp buildsp(int s, int bx, unsigned int m) 73 73 { 74 74 union ieee754sp r; 75 75
+2 -2
arch/mips/math-emu/sp_div.c
··· 23 23 24 24 union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y) 25 25 { 26 - unsigned rm; 26 + unsigned int rm; 27 27 int re; 28 - unsigned bm; 28 + unsigned int bm; 29 29 30 30 COMPXSP; 31 31 COMPYSP;
+1 -1
arch/mips/math-emu/sp_fint.c
··· 23 23 24 24 union ieee754sp ieee754sp_fint(int x) 25 25 { 26 - unsigned xm; 26 + unsigned int xm; 27 27 int xe; 28 28 int xs; 29 29
+3 -3
arch/mips/math-emu/sp_maddf.c
··· 20 20 { 21 21 int re; 22 22 int rs; 23 - unsigned rm; 24 - uint64_t rm64; 25 - uint64_t zm64; 23 + unsigned int rm; 24 + u64 rm64; 25 + u64 zm64; 26 26 int s; 27 27 28 28 COMPXSP;
+5 -5
arch/mips/math-emu/sp_mul.c
··· 25 25 { 26 26 int re; 27 27 int rs; 28 - unsigned rm; 28 + unsigned int rm; 29 29 unsigned short lxm; 30 30 unsigned short hxm; 31 31 unsigned short lym; 32 32 unsigned short hym; 33 - unsigned lrm; 34 - unsigned hrm; 35 - unsigned t; 36 - unsigned at; 33 + unsigned int lrm; 34 + unsigned int hrm; 35 + unsigned int t; 36 + unsigned int at; 37 37 38 38 COMPXSP; 39 39 COMPYSP;