diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-02-05 20:59:33 -0800 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-03-09 15:12:53 +0100 |
| commit | 5ef22361fa98a44409f11a10cb7d08b5cbf6d57c (patch) | |
| tree | 34f54298372a6c1e5366854f33e83d902043ce38 /rust/kernel/gpu/git@git.tavy.me:linux-stable.git | |
| parent | 8ef45923fdcb7ec44e3a965bcbf41723e20814e4 (diff) | |
dm-verity-fec: simplify computation of ileaved
fec_read_bufs() just iterates over a sequence of message blocks with
step size region_blocks. At each step, 'ileaved' is just the offset (in
bytes) to one of these blocks. Compute it in the straightforward way,
eliminating fec_interleave().
In more detail, previously the code computed
'ileaved = (n / k) + (n % k) * (region_blocks * block_size)'
where n = rsb * k + i and 0 <= i < k. Substituting 'n' gives:
ileaved = ((rsb * k + i) / k) + ((rsb * k + i) % k) * region_blocks * block_size
= rsb + (i * region_blocks * block_size)
The result is more efficient and easier to understand.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'rust/kernel/gpu/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
