提交 add496c0 编写于 作者: G Gilad Ben-Yossef 提交者: Greg Kroah-Hartman

staging: ccree: replace open coded loop with for

Replace open coded register writing loop with a for.
Further simplify code by using a local var to precompute
the register address for readability.
Signed-off-by: NGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2712dc7b
...@@ -164,15 +164,17 @@ static inline void enqueue_seq( ...@@ -164,15 +164,17 @@ static inline void enqueue_seq(
void __iomem *cc_base, void __iomem *cc_base,
struct cc_hw_desc seq[], unsigned int seq_len) struct cc_hw_desc seq[], unsigned int seq_len)
{ {
int i; int i, w;
void * __iomem reg = cc_base + CC_REG(DSCRPTR_QUEUE_WORD0);
/*
* We do indeed write all 6 command words to the same
* register. The HW supports this.
*/
for (i = 0; i < seq_len; i++) { for (i = 0; i < seq_len; i++) {
writel_relaxed(seq[i].word[0], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0))); for (w = 0; w <= 5; w++)
writel_relaxed(seq[i].word[1], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0))); writel_relaxed(seq[i].word[w], reg);
writel_relaxed(seq[i].word[2], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0)));
writel_relaxed(seq[i].word[3], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0)));
writel_relaxed(seq[i].word[4], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0)));
writel_relaxed(seq[i].word[5], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0)));
#ifdef DX_DUMP_DESCS #ifdef DX_DUMP_DESCS
dev_dbg(dev, "desc[%02d]: 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X\n", dev_dbg(dev, "desc[%02d]: 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X\n",
i, seq[i].word[0], seq[i].word[1], seq[i].word[2], i, seq[i].word[0], seq[i].word[1], seq[i].word[2],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册