diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2009-01-06 15:46:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-06 15:46:46 -0500 |
commit | 2eac5a0d3a84acd267ff7aac5b45c020bfcb158c (patch) | |
tree | ab9dbf30468808bbb8afb235735f28ea35a54792 /arch/sparc | |
parent | b2c0805f77ff6b87bb18994ce70352fecc3ce7fc (diff) |
sparc64: refactor code in viohs.c
The sparc64 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/kernel/viohs.c: In function `vio_control_pkt_engine':
arch/sparc/kernel/viohs.c:335: warning: 'nver' 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>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/viohs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc/kernel/viohs.c b/arch/sparc/kernel/viohs.c index 708fa1705fbe..aa6ac70d4fd5 100644 --- a/arch/sparc/kernel/viohs.c +++ b/arch/sparc/kernel/viohs.c | |||
@@ -337,8 +337,10 @@ static int process_ver_nack(struct vio_driver_state *vio, | |||
337 | viodbg(HS, "GOT VERSION NACK maj[%u] min[%u] devclass[%u]\n", | 337 | viodbg(HS, "GOT VERSION NACK maj[%u] min[%u] devclass[%u]\n", |
338 | pkt->major, pkt->minor, pkt->dev_class); | 338 | pkt->major, pkt->minor, pkt->dev_class); |
339 | 339 | ||
340 | if ((pkt->major == 0 && pkt->minor == 0) || | 340 | if (pkt->major == 0 && pkt->minor == 0) |
341 | !(nver = find_by_major(vio, pkt->major))) | 341 | return handshake_failure(vio); |
342 | nver = find_by_major(vio, pkt->major); | ||
343 | if (!nver) | ||
342 | return handshake_failure(vio); | 344 | return handshake_failure(vio); |
343 | 345 | ||
344 | if (send_version(vio, nver->major, nver->minor) < 0) | 346 | if (send_version(vio, nver->major, nver->minor) < 0) |