bcm53xx: use upstream accepted fix for ARM core aborts
[openwrt/openwrt.git] / target / linux / generic / patches-4.4 / 143-mtd-bcm47xxpart-fix-parsing-first-block-after-aligne.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Subject: [PATCH] mtd: bcm47xxpart: fix parsing first block after aligned TRX
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset=UTF-8
5 Content-Transfer-Encoding: 8bit
6
7 After parsing TRX we should skip to the first block placed behind it.
8 Our code was working only with TRX with length not aligned to the
9 blocksize. In other cases (length aligned) it was missing the block
10 places right after TRX.
11
12 This fixes calculation and simplifies the comment.
13
14 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
15 ---
16 drivers/mtd/bcm47xxpart.c | 10 ++++------
17 1 file changed, 4 insertions(+), 6 deletions(-)
18
19 --- a/drivers/mtd/bcm47xxpart.c
20 +++ b/drivers/mtd/bcm47xxpart.c
21 @@ -229,12 +229,10 @@ static int bcm47xxpart_parse(struct mtd_
22
23 last_trx_part = curr_part - 1;
24
25 - /*
26 - * We have whole TRX scanned, skip to the next part. Use
27 - * roundown (not roundup), as the loop will increase
28 - * offset in next step.
29 - */
30 - offset = rounddown(offset + trx->length, blocksize);
31 + /* Jump to the end of TRX */
32 + offset = roundup(offset + trx->length, blocksize);
33 + /* Next loop iteration will increase the offset */
34 + offset -= blocksize;
35 continue;
36 }
37