summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-01-06 10:02:38 -0800
committerDavid S. Miller <davem@davemloft.net>2009-01-06 10:23:22 -0800
commitb2c0805f77ff6b87bb18994ce70352fecc3ce7fc (patch)
treed5b02b97654d787547c31d3d3be085bfb317a437 /arch/sparc/kernel
parent238c6d54830c624f34ac9cf123ac04aebfca5013 (diff)
downloadblackbird-obmc-linux-b2c0805f77ff6b87bb18994ce70352fecc3ce7fc.tar.gz
blackbird-obmc-linux-b2c0805f77ff6b87bb18994ce70352fecc3ce7fc.zip
sparc: make proces_ver_nack a bit more readable
Impact: clean up The code in process_ver_nack is a little obfuscated. This change makes it a bit more readable by humans. It removes the complex if statement and replaces it with a cleaner flow of control. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/ldc.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index d68982330f66..6ce5d2598a09 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -625,22 +625,23 @@ static int process_ver_ack(struct ldc_channel *lp, struct ldc_version *vp)
static int process_ver_nack(struct ldc_channel *lp, struct ldc_version *vp)
{
struct ldc_version *vap;
+ struct ldc_packet *p;
+ unsigned long new_tail;
- if ((vp->major == 0 && vp->minor == 0) ||
- !(vap = find_by_major(vp->major))) {
+ if (vp->major == 0 && vp->minor == 0)
+ return ldc_abort(lp);
+
+ vap = find_by_major(vp->major);
+ if (!vap)
return ldc_abort(lp);
- } else {
- struct ldc_packet *p;
- unsigned long new_tail;
- p = handshake_compose_ctrl(lp, LDC_INFO, LDC_VERS,
+ p = handshake_compose_ctrl(lp, LDC_INFO, LDC_VERS,
vap, sizeof(*vap),
&new_tail);
- if (p)
- return send_tx_packet(lp, p, new_tail);
- else
- return ldc_abort(lp);
- }
+ if (!p)
+ return ldc_abort(lp);
+
+ return send_tx_packet(lp, p, new_tail);
}
static int process_version(struct ldc_channel *lp,
OpenPOWER on IntegriCloud