From patchwork Wed Dec 15 11:01:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12696258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61E87C433F5 for ; Wed, 15 Dec 2021 11:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fpOWF2xE6lCus3XLEvjR3eG1tgSgpY1gXak4QPdJ6qM=; b=airDma32FnFNfn OxaOc1yR/c38Yq/oHtz46YtH4W/ERbsDXUv11KFgeRuSL5rbTrz/pxUPeGwvUWn9UUdUXR56YVdUt mV2cvJgDKk3NT0pwWRv+V+UL6smhOedLCX5+OCoPJdFnItVBNFeQLiYlHd3sMZc+MtHe0xmLRrLKZ 21YhklbD4+hr8PTsghWzeNZKMgAhEudN7RfCk2+t4rH90cCjvsC+WUskYhtcMhvrhypRLiDrfV6ki Ztl73FbTknZpJp4qgfo2MLvlBaWSi8sC8Zf3lP3BUb6IGjTzAc+BH/8Ra0qh+2KK2fqGrNxRlErZ6 zBJUGwevGr/hRSCbfKCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxSB3-000Qml-Ug; Wed, 15 Dec 2021 11:10:30 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxS2X-000MFN-OK for linux-arm-kernel@lists.infradead.org; Wed, 15 Dec 2021 11:01:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1639566101; x=1671102101; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l7DYN6EzzogTUQIaI5uuaqM3uDK/flgG0AmVT1JLkvc=; b=BOxnIxqHEZT4yFvlIsdEWxR8ztnohM4CXc6OMIlY4cwzhEWfyIdf5j7g lD+aq5kesIandk506N4tn/f6t4gStMOSQEz8pNkTK+VxExFUlJ9hc23L9 pn5Hva7SvzrmwvJIL8WTf3Opv7ttm4xN5c/IIYiuqx4D/1Uy2DGxTMnoi tV7pNsT+kMzw/TvXTKCB9jRk7oV/qckmBAFESWDU1J+zv9fkx9LhXW1V0 RVmVaOp46GKVkYXdGkQhfi31cYSclRcjvR1gy/ZhZew2jvc9AUxO3/0PK ZuwO9fPO26V68O2NpCTStZealFdiJGQJjlutMb/KuZzerCipvJ5E5cgLF g==; IronPort-SDR: o8CfNR0+lg6WOMERCQ3lgZrBaKvbjM3bGNy3ji3gY7rMCybmSm+hsrJpNX0/Mj62JVczP2CEaW 6afEJgknx9Z3RQVOjiIFOGtto1dW+FfD1hnSviiwSOkeIzPwNTZZbT2uGt8ILox9FNEQ16kMCG oaNXPfF7gQ6P7zKeov2uKPv7PXrq2QmiDayJTDLlKUJ+KIN6o/9BGw9lYQq6H5nTtYl5wIFcEy +TGuZWgcQsYeFIBeSisHN2yWdUEUah28hGZljC6MwdDSF0ecqvdM1M5A9cp1mChbtsmU2vuMAB pBcZ24Zz9xKKEeEDhK4uIgaG X-IronPort-AV: E=Sophos;i="5.88,207,1635231600"; d="scan'208";a="139842702" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Dec 2021 04:01:41 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 15 Dec 2021 04:01:40 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 15 Dec 2021 04:01:38 -0700 From: Tudor Ambarus To: Subject: [PATCH v3 08/12] dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_advance_work() Date: Wed, 15 Dec 2021 13:01:11 +0200 Message-ID: <20211215110115.191749-9-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215110115.191749-1-tudor.ambarus@microchip.com> References: <20211215110115.191749-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211215_030141_922012_6B528CD5 X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tudor Ambarus , mripard@kernel.org, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It's easier to read code with fewer levels of indentation, remove a level of indentation in at_xdmac_advance_work() if (!foo() & !bar()) { } was replaced by: if (foo() || bar()) return; Signed-off-by: Tudor Ambarus --- drivers/dma/at_xdmac.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index eeb03065d484..0b09ec752db4 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -1593,14 +1593,14 @@ static void at_xdmac_advance_work(struct at_xdmac_chan *atchan) * If channel is enabled, do nothing, advance_work will be triggered * after the interruption. */ - if (!at_xdmac_chan_is_enabled(atchan) && !list_empty(&atchan->xfers_list)) { - desc = list_first_entry(&atchan->xfers_list, - struct at_xdmac_desc, - xfer_node); - dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc); - if (!desc->active_xfer) - at_xdmac_start_xfer(atchan, desc); - } + if (at_xdmac_chan_is_enabled(atchan) || list_empty(&atchan->xfers_list)) + return; + + desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, + xfer_node); + dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, desc); + if (!desc->active_xfer) + at_xdmac_start_xfer(atchan, desc); } static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)