Skip to content

Commit

Permalink
arch: tile: kernel: unaligned.c: Cleaning up uninitialized variables
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
Rickard Strandqvist authored and Chris Metcalf committed Jun 8, 2014
1 parent 60f917b commit 50b9ac1
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions arch/tile/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,7 @@ static void find_regs(tilegx_bundle_bits bundle, uint64_t *rd, uint64_t *ra,
int i;
uint64_t reg;
uint64_t reg_map = 0, alias_reg_map = 0, map;
bool alias;

*ra = -1;
*rb = -1;

if (rd)
*rd = -1;

*clob1 = -1;
*clob2 = -1;
*clob3 = -1;
alias = false;
bool alias = false;

/*
* Parse fault bundle, find potential used registers and mark
Expand Down Expand Up @@ -569,7 +558,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
tilegx_bundle_bits bundle_2 = 0;
/* If bundle_2_enable = false, bundle_2 is fnop/nop operation. */
bool bundle_2_enable = true;
uint64_t ra, rb, rd = -1, clob1, clob2, clob3;
uint64_t ra = -1, rb = -1, rd = -1, clob1 = -1, clob2 = -1, clob3 = -1;
/*
* Indicate if the unalign access
* instruction's registers hit with
Expand Down

0 comments on commit 50b9ac1

Please sign in to comment.