Received: by 10.223.176.5 with SMTP id f5csp1845219wra; Sun, 4 Feb 2018 13:38:07 -0800 (PST) X-Google-Smtp-Source: AH8x225dPVCDAUCo65/VQ38HtvVUx9luNb0DTvf+zXwwVzS5KQxF/9WLvsXGceXElWQrGJa+lslZ X-Received: by 10.99.153.1 with SMTP id d1mr26741014pge.190.1517780287159; Sun, 04 Feb 2018 13:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517780287; cv=none; d=google.com; s=arc-20160816; b=U+w7NzuhdxAwBvLoIhpJDXfE6C9VrpoZiUtgO2b2zpZ91KTCjLFZ6YbKPPjM89NdJm S188VeyKUyu5sgV8Lz1doL3i8kr6Ag8PFp5HOvzkhwP1Kzw+um4Bef2/z7QxISQjwEQ/ X+JXriXuCtLE1k4nI8iQieCfFZ3hgdYu2AmdI2+xLhiB+chigsYYRYKZACWz1YloVQcx kiM/NxBKmiiE8x2YRPvnwQTvqMEvHK8AwmNcdhrKjV0W1wQDoMm1lXSxrHv160MFg+1D pCKEMemm8pbKZ+0juItbcPII3lm81LWpnJB8GhEAtFDGkja2oJ8MBTqactweY1cHdXIt AkUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=9UdEn1VngfwLwTXzQx4m6bw3D25wDFPuKkFuVCiz9UU=; b=TnfpWV8Skl2NMgYds+RgIVx/9U0eHfAcGWwBkJxT2lRSRYceo9hues5K1Pm0iX8jSn //yKkIzbxNju/1st/6QvvpKt0D+jIkzGKQ2k8v/lE0ZT7DHPzGrf/MmJDbAGrtggljUo RVey1SBXL1VQN3moGrfy2toSCzPydcIRWEm/Wov6pe64+p/5ULNdiJydattcgqOo1DuE RgzqQZ/dpY+I0U/Q8KvRe5Jf0scDVzG/b9XkLLplNxRL455Hl4VE1sNk6ojXg9iiymfO R/BwyFDKIofOTbxRSi3HJERDi8Ybhazj5O3fZROFtugYFDa5l44WGzJ5laRyfAF4uZf0 Wu7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si5928216plm.433.2018.02.04.13.37.52; Sun, 04 Feb 2018 13:38:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbeBDVhT (ORCPT + 99 others); Sun, 4 Feb 2018 16:37:19 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:61627 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751938AbeBDVhP (ORCPT ); Sun, 4 Feb 2018 16:37:15 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w14LXWEs032412; Sun, 4 Feb 2018 22:36:37 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2fw339fcjk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 04 Feb 2018 22:36:37 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A479831; Sun, 4 Feb 2018 21:36:36 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 71782AAD7; Sun, 4 Feb 2018 21:36:36 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.44) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sun, 4 Feb 2018 22:36:36 +0100 Received: from localhost (10.129.5.167) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.352.0; Sun, 4 Feb 2018 22:36:35 +0100 From: Philippe Cornu To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Philippe Cornu , Brian Norris , Benjamin Gaignard , Bhumika Goyal , , , "Sandy Huang" , Heiko Stubner , , CC: Yannick Fertre , Vincent Abriou , Alexandre Torgue Subject: [PATCH] drm/bridge/synopsys: dsi: readl_poll_timeout return value clean up Date: Sun, 4 Feb 2018 22:36:24 +0100 Message-ID: <20180204213624.18288-1-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.129.5.167] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-04_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The readl_poll_timeout() return value is 0 in case of success so it is better to detect errors without taking care of the return value sign. Signed-off-by: Philippe Cornu --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 65aeb3f78b48..4d0e8471a15c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -342,7 +342,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val) ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, !(val & GEN_CMD_FULL), 1000, CMD_PKT_STATUS_TIMEOUT_US); - if (ret < 0) { + if (ret) { dev_err(dsi->dev, "failed to get available command FIFO\n"); return ret; } @@ -353,7 +353,7 @@ static int dw_mipi_dsi_gen_pkt_hdr_write(struct dw_mipi_dsi *dsi, u32 hdr_val) ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, (val & mask) == mask, 1000, CMD_PKT_STATUS_TIMEOUT_US); - if (ret < 0) { + if (ret) { dev_err(dsi->dev, "failed to write command FIFO\n"); return ret; } @@ -385,7 +385,7 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi, ret = readl_poll_timeout(dsi->base + DSI_CMD_PKT_STATUS, val, !(val & GEN_PLD_W_FULL), 1000, CMD_PKT_STATUS_TIMEOUT_US); - if (ret < 0) { + if (ret) { dev_err(dsi->dev, "failed to get available write payload FIFO\n"); return ret; @@ -716,13 +716,13 @@ static void dw_mipi_dsi_dphy_enable(struct dw_mipi_dsi *dsi) ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val, val & PHY_LOCK, 1000, PHY_STATUS_TIMEOUT_US); - if (ret < 0) + if (ret) DRM_DEBUG_DRIVER("failed to wait phy lock state\n"); ret = readl_poll_timeout(dsi->base + DSI_PHY_STATUS, val, val & PHY_STOP_STATE_CLK_LANE, 1000, PHY_STATUS_TIMEOUT_US); - if (ret < 0) + if (ret) DRM_DEBUG_DRIVER("failed to wait phy clk lane stop state\n"); } -- 2.15.1