From patchwork Thu Jul 14 12:42:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 9229763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C3E36075D for ; Thu, 14 Jul 2016 12:46:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E71D27FA9 for ; Thu, 14 Jul 2016 12:46:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71E34281D2; Thu, 14 Jul 2016 12:46:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2717227FA9 for ; Thu, 14 Jul 2016 12:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751150AbcGNMn3 (ORCPT ); Thu, 14 Jul 2016 08:43:29 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:48410 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbcGNMn2 (ORCPT ); Thu, 14 Jul 2016 08:43:28 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id u6ECguQB002810; Thu, 14 Jul 2016 07:42:56 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u6ECguNL019460; Thu, 14 Jul 2016 07:42:56 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Thu, 14 Jul 2016 07:42:55 -0500 Received: from dlep33.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u6ECgjMW018322; Thu, 14 Jul 2016 07:42:53 -0500 From: Peter Ujfalusi To: CC: , , , , , Subject: [PATCH 3/7] dmaengine: omap-dma: Simplify omap_dma_callback Date: Thu, 14 Jul 2016 15:42:38 +0300 Message-ID: <20160714124242.7579-4-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.9.1 In-Reply-To: <20160714124242.7579-1-peter.ujfalusi@ti.com> References: <20160714124242.7579-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Flatten the indentation level of the function which gives better view on the cases we handle here. Signed-off-by: Peter Ujfalusi --- drivers/dma/omap-dma.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index f7b0b0c668fb..6d134252ed61 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -445,15 +445,13 @@ static void omap_dma_callback(int ch, u16 status, void *data) spin_lock_irqsave(&c->vc.lock, flags); d = c->desc; if (d) { - if (!c->cyclic) { - if (c->sgidx < d->sglen) { - omap_dma_start_sg(c, d); - } else { - vchan_cookie_complete(&d->vd); - omap_dma_start_desc(c); - } - } else { + if (c->cyclic) { vchan_cyclic_callback(&d->vd); + } else if (c->sgidx == d->sglen) { + vchan_cookie_complete(&d->vd); + omap_dma_start_desc(c); + } else { + omap_dma_start_sg(c, d); } } spin_unlock_irqrestore(&c->vc.lock, flags);