summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-10-13 17:29:00 +0100
committerDavid S. Miller <davem@davemloft.net>2017-10-14 18:37:57 -0700
commit5dc874252faa818426480a7c00fa05738fe05402 (patch)
tree7bd9b946248e29b2298cf7fd2b71859d83c8c1a0
parentae96d3331e0549e075299f17193d22423e462b80 (diff)
cxgb4: fix missing break in switch and indent return statements
The break statement for the Macronix case is missing and will fall through to the Winbond case and re-assign the size setting. Fix this by adding the missing break statement. Also correctly indent the return statements. Detected by CoverityScan, CID#1458020 ("Missing break in switch") Fixes: 96ac18f14a5a ("cxgb4: Add support for new flash parts") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 8fa40f9e75c4..006414758f65 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -8404,7 +8404,7 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Micron Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
break;
}
@@ -8423,8 +8423,9 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Macronix Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
+ break;
}
case 0xef: { /* Winbond */
/* This Density -> Size decoding table is taken from Winbond
@@ -8441,7 +8442,7 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Winbond Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
break;
}