diff options
| author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-05-31 19:00:13 -0400 |
|---|---|---|
| committer | Chris Metcalf <cmetcalf@tilera.com> | 2014-06-07 21:39:11 -0400 |
| commit | 50b9ac1813f7f2f13c937a1484c2fe09c4d590ce (patch) | |
| tree | 3b7c56821f9de10d8741fc2d3694a31ad5dca654 | |
| parent | 60f917b8de8d4a88c06a3f4727d0658082756de6 (diff) | |
arch: tile: kernel: unaligned.c: Cleaning up uninitialized variables
There is a risk that the variable will be used without being initialized.
This was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> [minor cleanups]
| -rw-r--r-- | arch/tile/kernel/unaligned.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/tile/kernel/unaligned.c b/arch/tile/kernel/unaligned.c index b030b4e78845..c02ea2a45f67 100644 --- a/arch/tile/kernel/unaligned.c +++ b/arch/tile/kernel/unaligned.c | |||
| @@ -182,18 +182,7 @@ static void find_regs(tilegx_bundle_bits bundle, uint64_t *rd, uint64_t *ra, | |||
| 182 | int i; | 182 | int i; |
| 183 | uint64_t reg; | 183 | uint64_t reg; |
| 184 | uint64_t reg_map = 0, alias_reg_map = 0, map; | 184 | uint64_t reg_map = 0, alias_reg_map = 0, map; |
| 185 | bool alias; | 185 | bool alias = false; |
| 186 | |||
| 187 | *ra = -1; | ||
| 188 | *rb = -1; | ||
| 189 | |||
| 190 | if (rd) | ||
| 191 | *rd = -1; | ||
| 192 | |||
| 193 | *clob1 = -1; | ||
| 194 | *clob2 = -1; | ||
| 195 | *clob3 = -1; | ||
| 196 | alias = false; | ||
| 197 | 186 | ||
| 198 | /* | 187 | /* |
| 199 | * Parse fault bundle, find potential used registers and mark | 188 | * Parse fault bundle, find potential used registers and mark |
| @@ -569,7 +558,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, | |||
| 569 | tilegx_bundle_bits bundle_2 = 0; | 558 | tilegx_bundle_bits bundle_2 = 0; |
| 570 | /* If bundle_2_enable = false, bundle_2 is fnop/nop operation. */ | 559 | /* If bundle_2_enable = false, bundle_2 is fnop/nop operation. */ |
| 571 | bool bundle_2_enable = true; | 560 | bool bundle_2_enable = true; |
| 572 | uint64_t ra, rb, rd = -1, clob1, clob2, clob3; | 561 | uint64_t ra = -1, rb = -1, rd = -1, clob1 = -1, clob2 = -1, clob3 = -1; |
| 573 | /* | 562 | /* |
| 574 | * Indicate if the unalign access | 563 | * Indicate if the unalign access |
| 575 | * instruction's registers hit with | 564 | * instruction's registers hit with |
