mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 21:56:39 +07:00
iop-adma: redundant/wrong tests in iop_*_count()?
When we reach the loop, len is at least 1, we only stay in the loop when len is at least MAX_BYTE_COUNT + 1, MAX_BYTE_COUNT is subtracted in each iteration. So when we leave the loop, or didn't take it, len is at least 1. Testing whether len is non-zero appears redundant. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
67b9124f73
commit
f1acb878b6
@ -366,7 +366,6 @@ static inline int iop_chan_xor_slot_count(size_t len, int src_cnt,
|
||||
slot_cnt += *slots_per_op;
|
||||
}
|
||||
|
||||
if (len)
|
||||
slot_cnt += *slots_per_op;
|
||||
|
||||
return slot_cnt;
|
||||
@ -389,7 +388,6 @@ static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
|
||||
slot_cnt += *slots_per_op;
|
||||
}
|
||||
|
||||
if (len)
|
||||
slot_cnt += *slots_per_op;
|
||||
|
||||
return slot_cnt;
|
||||
@ -737,12 +735,10 @@ iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
|
||||
i += slots_per_op;
|
||||
} while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
|
||||
|
||||
if (len) {
|
||||
iter = iop_hw_desc_slot_idx(hw_desc, i);
|
||||
iter->byte_count = len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
|
||||
struct iop_adma_chan *chan,
|
||||
|
Loading…
Reference in New Issue
Block a user