From patchwork Sun Jun 21 15:57:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 11618309 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBAC514B7 for ; Mon, 22 Jun 2020 15:47:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 953F72073E for ; Mon, 22 Jun 2020 15:47:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="noAJgdQb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZO1+qIyH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 953F72073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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:In-Reply-To:References:List-Owner; bh=qHAZVZ4zEVwTaUIEnrufpOt2PqCF+EtVnzg3i2w+wVU=; b=noAJgdQbIXYza/UBrA4M60JA4D /ESW+pUCfGhgpKz4KXuOiiV6YCewT8CeXIJWeMNVmjaFpAm/U1TBmf4uwS5+5RpX+tV5wYMvAJ4UL HqhKZOxH9dEThB7tRalYcBZsR7uXIVHO1+XjbsOdEY5ZHKrX1dCWV97TBVbdz0wa1GjpMLTHetyTA o/nShs9H64dkBqgDztRYxxI65f5Go9Ay7S34K7mPEjx3OldmEGzXOLETSbAH5ueetgli1OTGy2yG3 /V1Wk4e9qgZQPy1hkLtBzeCH1tCMLDfZRf9CWzup/8LHgkYy6ST0mscbXGUkShpZjE6p6qI0hESGM Z8I4JojA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnOdj-0007PA-Ph; Mon, 22 Jun 2020 15:45:43 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jn2Lz-0000kR-0V for linux-arm-kernel@lists.infradead.org; Sun, 21 Jun 2020 15:57:55 +0000 Received: by mail-qk1-x741.google.com with SMTP id k18so4330459qke.4 for ; Sun, 21 Jun 2020 08:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kb5+aZrzNx6tSI6L/Ms1DanPrl0vUL+IeDMeU6prOnU=; b=ZO1+qIyH0nQp/ljo0rnCFrFsFc4WQdkD+czFD0nuKMTgFIjbIq9vrCc6VVyXKWOf2B xTUygwZtr1j5jQhA/IuOQoTmrwGyUZNQE4Ynl4JuwBdOWxswhEwyS/WuoRTtt/MuCjDS OSDHF9uvbYGoejYse9YG/iZj1Ra6TQ3ApgSau5M2TjWKaAVOOmoxubv3HZXEz5rNKpBl 6Czk8TArS/X2STiaKWuFCGY0j8hyCgapra8xKC4f6IiugwC8NbjpwBHdydITQ5zraUkH Vdv6rcgsTOieuDj+Ru+UoRVqbGjKdzx90xNh1LNIPmS+I9mvJOWpO8MjoPdUOFBkMDwK 6qGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kb5+aZrzNx6tSI6L/Ms1DanPrl0vUL+IeDMeU6prOnU=; b=gsQZHDkjUUDudLpy2DzbhAAhSV6mL6BHpdYqSw43Hqe4BQ4nLPzNa2dAnv3YxDXtwY kSmTpKGoaMMzLGilBxEzEBLbRVH5Vr5Qr8z+ugH36uuStlmqLGwid6PCPo3TIMQN97vJ rUNaGHvHHXSMJrSk+Gy2GLlFOXaVCWE0xQxIqe9gotkYj0JtcGrlI41u+QRq1E6Ff04E rAMeaaJ9YP9oMrNWhPl/kQ/Jy3k/7ZQAgrToNg3sA+T+f0o84EtlRSQATYxzWr9Yx5CG K+1tmoyO2AROsAW26s6ACDX6Yn+PgSgpNSh115BUnuFlzSsHmtq4RnNii8BRtfsX70kw VHPg== X-Gm-Message-State: AOAM5333rOxnN/OVi/+/H2OUA0bFABRrtKmHuF3CgNTnPyG4ndgZ5so4 r2Vp2+BE5Bm+56CWL8F+5NM= X-Google-Smtp-Source: ABdhPJx2WRPW9tE6une1UHHm2fK5tgAIYrpxF822hRAJ7Milj37p+bvnUpDBQ+1VEvPrvg5lbocRyw== X-Received: by 2002:a37:e30a:: with SMTP id y10mr12167937qki.151.1592755069422; Sun, 21 Jun 2020 08:57:49 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:92b:9524:444f:ca0e:d637]) by smtp.gmail.com with ESMTPSA id e11sm2267qtp.67.2020.06.21.08.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jun 2020 08:57:48 -0700 (PDT) From: Fabio Estevam To: vkoul@kernel.org Subject: [PATCH] dmaengine: imx-sdma: Fix: Remove 'always true' comparison Date: Sun, 21 Jun 2020 12:57:30 -0300 Message-Id: <20200621155730.28766-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [festevam[at]gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:741 listed in] [list.dnswl.org] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Fabio Estevam , linux-imx@nxp.com, frieder.schrempf@kontron.de, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org event_id0 is defined as 'unsigned int', so it is always greater or equal to zero. Remove the unneeded comparisons to fix the following W=1 build warning: drivers/dma/imx-sdma.c: In function 'sdma_free_chan_resources': drivers/dma/imx-sdma.c:1334:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 1334 | if (sdmac->event_id0 >= 0) | ^~ drivers/dma/imx-sdma.c: In function 'sdma_config': drivers/dma/imx-sdma.c:1635:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 1635 | if (sdmac->event_id0 >= 0) { | Fixes: 25962e1a7f1d ("dmaengine: imx-sdma: Fix the event id check to include RX event for UART6") Reported-by: kernel test robot Signed-off-by: Fabio Estevam --- drivers/dma/imx-sdma.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 91774039ae5d..270992c4fe47 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1331,8 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdma_channel_synchronize(chan); - if (sdmac->event_id0 >= 0) - sdma_event_disable(sdmac, sdmac->event_id0); + sdma_event_disable(sdmac, sdmac->event_id0); if (sdmac->event_id1) sdma_event_disable(sdmac, sdmac->event_id1); @@ -1632,11 +1631,9 @@ static int sdma_config(struct dma_chan *chan, memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg)); /* Set ENBLn earlier to make sure dma request triggered after that */ - if (sdmac->event_id0 >= 0) { - if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events) - return -EINVAL; - sdma_event_enable(sdmac, sdmac->event_id0); - } + if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events) + return -EINVAL; + sdma_event_enable(sdmac, sdmac->event_id0); if (sdmac->event_id1) { if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)