Skip to content

Commit f2e576b

Browse files
akpm00Ingo Molnar
authored andcommitted
i386: arch/x86/math-emu/reg_ld_str.c: fix warning
arch/x86/math-emu/reg_ld_str.c:380: warning: 'l[0]' may be used uninitialized in this function arch/x86/math-emu/reg_ld_str.c:380: warning: 'l[1]' may be used uninitialized in this function I can't actually spot the bug here. There's one obvious place, but fixing that didn't shut the warning up. Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent cc7594e commit f2e576b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

arch/x86/math-emu/reg_ld_str.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
383383
int exp;
384384
FPU_REG tmp;
385385

386+
l[0] = 0;
387+
l[1] = 0;
386388
if (st0_tag == TAG_Valid) {
387389
reg_copy(st0_ptr, &tmp);
388390
exp = exponent(&tmp);
389391

390392
if (exp < DOUBLE_Emin) { /* It may be a denormal */
391393
addexponent(&tmp, -DOUBLE_Emin + 52); /* largest exp to be 51 */
392-
393-
denormal_arg:
394-
394+
denormal_arg:
395395
if ((precision_loss = FPU_round_to_int(&tmp, st0_tag))) {
396396
#ifdef PECULIAR_486
397397
/* Did it round to a non-denormal ? */
@@ -477,8 +477,7 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
477477

478478
/* This is a special case: see sec 16.2.5.1 of the 80486 book */
479479
/* Overflow to infinity */
480-
l[0] = 0x00000000; /* Set to */
481-
l[1] = 0x7ff00000; /* + INF */
480+
l[1] = 0x7ff00000; /* Set to + INF */
482481
} else {
483482
if (precision_loss) {
484483
if (increment)
@@ -492,8 +491,6 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
492491
}
493492
} else if (st0_tag == TAG_Zero) {
494493
/* Number is zero */
495-
l[0] = 0;
496-
l[1] = 0;
497494
} else if (st0_tag == TAG_Special) {
498495
st0_tag = FPU_Special(st0_ptr);
499496
if (st0_tag == TW_Denormal) {
@@ -508,7 +505,6 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
508505
reg_copy(st0_ptr, &tmp);
509506
goto denormal_arg;
510507
} else if (st0_tag == TW_Infinity) {
511-
l[0] = 0;
512508
l[1] = 0x7ff00000;
513509
} else if (st0_tag == TW_NaN) {
514510
/* Is it really a NaN ? */
@@ -532,7 +528,6 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
532528
EXCEPTION(EX_Invalid);
533529
if (!(control_word & CW_Invalid))
534530
return 0;
535-
l[0] = 0;
536531
l[1] = 0xfff80000;
537532
}
538533
}

0 commit comments

Comments
 (0)