diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-02-13 15:54:03 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-02-28 22:22:12 -0700 |
commit | f1acb878b6070941e844dfc4ca1b3b9e5a70426c (patch) | |
tree | ee42486424fea38a50136f95379b4bc42d0c3d5f /arch/arm | |
parent | 67b9124f734b22b30d9adf18c39fe795e2901070 (diff) | |
download | kernel_samsung_smdk4412-f1acb878b6070941e844dfc4ca1b3b9e5a70426c.zip kernel_samsung_smdk4412-f1acb878b6070941e844dfc4ca1b3b9e5a70426c.tar.gz kernel_samsung_smdk4412-f1acb878b6070941e844dfc4ca1b3b9e5a70426c.tar.bz2 |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/hardware/iop3xx-adma.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/include/asm/hardware/iop3xx-adma.h b/arch/arm/include/asm/hardware/iop3xx-adma.h index 1a8c727..9b28f12 100644 --- a/arch/arm/include/asm/hardware/iop3xx-adma.h +++ b/arch/arm/include/asm/hardware/iop3xx-adma.h @@ -366,8 +366,7 @@ 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; + slot_cnt += *slots_per_op; return slot_cnt; } @@ -389,8 +388,7 @@ 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; + slot_cnt += *slots_per_op; return slot_cnt; } @@ -737,10 +735,8 @@ 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; - } + iter = iop_hw_desc_slot_idx(hw_desc, i); + iter->byte_count = len; } } |