* ocrdma: missing break in switch statement.
@ 2014-01-29 16:22 Dave Jones
0 siblings, 0 replies; only message in thread
From: Dave Jones @ 2014-01-29 16:22 UTC (permalink / raw)
To: Linux Kernel; +Cc: parav.pandit, roland
I've been going through the 'missing break' warnings in coverity, and there's a bunch
in infiniband. A lot look intentional, but this one can't be right.
We set a variable, and then immediately overwrite it.
instead of adding break spaghetti, just return the correct value.
Signed-off-by: Dave Jones <davej@fedoraproject.org>
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 1664d648cbfc..b45b7f8d9103 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -234,9 +234,9 @@ static int ocrdma_get_mbx_errno(u32 status)
case OCRDMA_MBX_STATUS_FAILED:
switch (add_status) {
case OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES:
- err_num = -EAGAIN;
- break;
+ return -EAGAIN;
}
+
default:
err_num = -EFAULT;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-29 16:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29 16:22 ocrdma: missing break in switch statement Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox