Skip to content

Commit

Permalink
sparc: refactor code in fault_32.c
Browse files Browse the repository at this point in the history
The sparc allmodconfig build broke due to enabling of the
branch_tracer that does some very clever things with
all if conditions. This caused my gcc 3.4.5 to be so confused that
it emitted a warning:

arch/sparc/mm/fault_32.c: In function `do_sparc_fault':
arch/sparc/mm/fault_32.c:176: warning: 'fixup' might be used uninitialized in this function

And with -Werror this broke the build.

Refactor code so it:
1) becomes more readable
2) no longer emit a warning with the branch_tracer enabled

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed Jan 6, 2009
1 parent ff9aefb commit 0157141
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/sparc/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
/* Is this in ex_table? */
no_context:
g2 = regs->u_regs[UREG_G2];
if (!from_user && (fixup = search_extables_range(regs->pc, &g2))) {
if (!from_user) {
fixup = search_extables_range(regs->pc, &g2);
if (fixup > 10) { /* Values below are reserved for other things */
extern const unsigned __memset_start[];
extern const unsigned __memset_end[];
Expand Down

0 comments on commit 0157141

Please sign in to comment.