From patchwork Tue Aug 2 14:06:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12934709 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 75638C00140 for ; Tue, 2 Aug 2022 14:09:57 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cIkP7+UnqqI3UmYdeMDVhU/F80UFBQ2L3vT55OB/h+c=; b=O5iXZaTrnpGF1W JPKf2BsmHV/rGrJ2aYZidBErAV2vWyCxrEFsCI3xDreoaRETtrlRZXYwsBNkU6AlKuYOg5yY31v4u owoScLsM4gcNk8fzYjlckGMCCzRL12q7e1KkkTOKvliYV1Dp/m2VrC8yfAwSGBCiDvF4rdfh48Z7q 1RkOuGzl7qKXqtvy5nRlpL4B7dOsJV4gT5b8rl8RrAYgIBMB8ihHuN0QoIDzq0XwxRseWS+w2YnfK dMMdPGWknonVIzAgNW4WGEuASq3USD0benXWA/6t+IxGB41WQ+k9nNrO3DQSEs0tfeFOTigs4wdp3 qzHeRVtuG0McGMmgw/7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIsZa-00Enya-Hk; Tue, 02 Aug 2022 14:08:39 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIsXe-00Emhn-3B for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2022 14:06:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659449199; x=1690985199; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+bD6Zoxnh572tnDwsX2wJkJ1zD0vSVAl0vbD6JMWMAw=; b=gIkVqULuz92EIooJ6JLR03NZhxYi7lMir6zNIh4moRhg0KQKxccsqg0J K+zzdm+W+G5F5ZzFL8Rq+3Vn1c/rXno7BiLtTbhUDJ81PFbRvvXZMNYiG ytWsJWPxd5WnbUKY5++bJgxJmmI56uWs5qeGyqtQRhZjTNwonYwJJnD13 1jn0soFdAIORt1eKWWmdWES+1JfpYfhNMiYmMyDJF9FqIux+8SS8Xx93J 9vlg9pv3IOR3XMOKkr234dqFvsF68c/VGiUOX6oHuUEui+bIrgQIpqJqm HvovaYOK5kuSojvNxdK+G+R+BjN3Pky7PkO4uYHQtcBOUiaQC9kY59mz/ A==; X-IronPort-AV: E=Sophos;i="5.93,211,1654585200"; d="scan'208";a="174586374" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Aug 2022 07:06:35 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 2 Aug 2022 07:06:33 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Tue, 2 Aug 2022 07:06:31 -0700 From: Tudor Ambarus To: CC: , , , , Tudor Ambarus Subject: [PATCH] dmaengine: at_xdmac: Replace two if statements with only one with two conditions Date: Tue, 2 Aug 2022 17:06:30 +0300 Message-ID: <20220802140630.243550-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220802_070638_195057_BA75A8C5 X-CRM114-Status: UNSURE ( 8.25 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a cosmetic change and replace two if statements with a single if statement with two conditions. In case the optional txstate parameter is NULL, we return the dma_cookie_status, which is fine, no functional change required. Signed-off-by: Tudor Ambarus --- drivers/dma/at_xdmac.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index def564d1e8fa..0aa3ae8d61e4 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -1463,10 +1463,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, bool initd; ret = dma_cookie_status(chan, cookie, txstate); - if (ret == DMA_COMPLETE) - return ret; - - if (!txstate) + if (ret == DMA_COMPLETE || !txstate) return ret; spin_lock_irqsave(&atchan->lock, flags);