ath10k: miscellaneous checkpatch fixes
[cascardo/linux.git] / drivers / dma / at_hdmac.c
index c13a3bb..ca9dd26 100644 (file)
@@ -294,14 +294,16 @@ static int atc_get_bytes_left(struct dma_chan *chan)
                        ret = -EINVAL;
                        goto out;
                }
-               atchan->remain_desc -= (desc_cur->lli.ctrla & ATC_BTSIZE_MAX)
-                                               << (desc_first->tx_width);
-               if (atchan->remain_desc < 0) {
+
+               count = (desc_cur->lli.ctrla & ATC_BTSIZE_MAX)
+                       << desc_first->tx_width;
+               if (atchan->remain_desc < count) {
                        ret = -EINVAL;
                        goto out;
-               } else {
-                       ret = atchan->remain_desc;
                }
+
+               atchan->remain_desc -= count;
+               ret = atchan->remain_desc;
        } else {
                /*
                 * Get residual bytes when current
@@ -893,12 +895,11 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
  * @period_len: number of bytes for each period
  * @direction: transfer direction, to or from device
  * @flags: tx descriptor status flags
- * @context: transfer context (ignored)
  */
 static struct dma_async_tx_descriptor *
 atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
                size_t period_len, enum dma_transfer_direction direction,
-               unsigned long flags, void *context)
+               unsigned long flags)
 {
        struct at_dma_chan      *atchan = to_at_dma_chan(chan);
        struct at_dma_slave     *atslave = chan->private;