summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElyes HAOUAS <ehaouas@noos.fr>2019-06-09 17:38:25 +0200
committerNico Huber <nico.h@gmx.de>2019-06-21 15:06:47 +0000
commit29e46d0aa6ec9ce0b5234bf3bdbd9f22c951252c (patch)
tree5c2e329fbd6ca08b5dfe66c65eb8fa00049ff7ab
parent504215b9f68e26938eea75afcbc22bdf389af991 (diff)
downloadflashrom-29e46d0aa6ec9ce0b5234bf3bdbd9f22c951252c.tar.gz
flashrom-29e46d0aa6ec9ce0b5234bf3bdbd9f22c951252c.tar.bz2
flashrom-29e46d0aa6ec9ce0b5234bf3bdbd9f22c951252c.zip
ichspi.c: Remove unneeded 'else'
'else' is not needed after a 'break' or 'return'. Change-Id: Ie000732158f27632ee92404c66a9aab43f3b374c Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33347 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r--ichspi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ichspi.c b/ichspi.c
index a30ca021f..6932678d7 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1244,21 +1244,21 @@ static void ich_hwseq_set_addr(uint32_t addr)
*/
static uint32_t ich_hwseq_get_erase_block_size(unsigned int addr)
{
+ uint8_t enc_berase;
+ static const uint32_t dec_berase[4] = {
+ 256,
+ 4 * 1024,
+ 8 * 1024,
+ 64 * 1024
+ };
+
if (hwseq_data.only_4k) {
return 4 * 1024;
- } else {
- uint8_t enc_berase;
- static const uint32_t dec_berase[4] = {
- 256,
- 4 * 1024,
- 8 * 1024,
- 64 * 1024
- };
-
- ich_hwseq_set_addr(addr);
- enc_berase = (REGREAD16(ICH9_REG_HSFS) & HSFS_BERASE) >> HSFS_BERASE_OFF;
- return dec_berase[enc_berase];
}
+
+ ich_hwseq_set_addr(addr);
+ enc_berase = (REGREAD16(ICH9_REG_HSFS) & HSFS_BERASE) >> HSFS_BERASE_OFF;
+ return dec_berase[enc_berase];
}
/* Polls for Cycle Done Status, Flash Cycle Error or timeout in 8 us intervals.