diff options
author | Gilad Ben-Yossef | 2017-11-13 15:45:37 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-11-27 09:20:39 +0100 |
commit | add496c0ba9c5b894f9a5e797a654488ba9822dd (patch) | |
tree | f32df790f03c847f2d3cceb68cdd7cc173dea879 /drivers/staging | |
parent | staging: ccree: make mem barrier per request (diff) | |
download | kernel-qcow2-linux-add496c0ba9c5b894f9a5e797a654488ba9822dd.tar.gz kernel-qcow2-linux-add496c0ba9c5b894f9a5e797a654488ba9822dd.tar.xz kernel-qcow2-linux-add496c0ba9c5b894f9a5e797a654488ba9822dd.zip |
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: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/ccree/ssi_request_mgr.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index f5041f71af5a..65c4d9f3f262 100644 --- a/drivers/staging/ccree/ssi_request_mgr.c +++ b/drivers/staging/ccree/ssi_request_mgr.c @@ -164,15 +164,17 @@ static inline void enqueue_seq( void __iomem *cc_base, 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++) { - writel_relaxed(seq[i].word[0], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0))); - writel_relaxed(seq[i].word[1], (cc_base + CC_REG(DSCRPTR_QUEUE_WORD0))); - 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))); + for (w = 0; w <= 5; w++) + writel_relaxed(seq[i].word[w], reg); #ifdef DX_DUMP_DESCS 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], |