Received: by 10.223.185.116 with SMTP id b49csp8487130wrg; Fri, 2 Mar 2018 02:40:21 -0800 (PST) X-Google-Smtp-Source: AG47ELu73w+xAE120hKtGxD7+F5YqX90Aupo9JExOnlSjjCvyATfy355wZp67lIWSWdsaySULG+o X-Received: by 10.98.138.66 with SMTP id y63mr5247148pfd.12.1519987221322; Fri, 02 Mar 2018 02:40:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519987221; cv=none; d=google.com; s=arc-20160816; b=FcS80N2RBMaZC8CeSLloIMuZlUm+/ba5A8tIFY+HUe/PJDDQ1Fw+BV2OlC/A/6JKPi lgCyfKNqPkt1y6dyTUrvJnM+EROh1BjM9MeqqvEhPgaTSovbiRN4ek6uDAj3Fz5l3vdc 8gpLGoQrmfCGHFg+upyXlPwOhsPR7hBwXzk6GKhxsgZlf3lt9GOLWVhGEnWi2iMUG51R DftQ29peSAIY/xTyqwCKOGpckSPxLRRHf/CJ3HrhYA+HR80PIRVUHRyQ/aZJMWYdw+NS LQMiSr8qYzg0VNygSKQTLQcjmlaKsTT84M/y3i4kzkPkuljthiGKbH4xFlnjx9+Ydrwp RCsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=U1DSkPhUOV3TcN3eTexchfSES0W9/10qgYUG0SCVtC8=; b=kFCZf4K8Jo3eJXi3mGr3Rz2A+F1s5/CJt34Tf62NwwVkChdfcNbST5bvFYDBQ89nQj bCfvO3lqEiqPSHVkCRTwZT+OqfknXRkcCot0gG3pT/TywJIQ9dHuz57W48XXzmAAUI3Q i+UyvKitTkOWkggnDrVknfpOHUizOjh9ivR6J5t6uowpgTKoE9usjpmKqp2oCv8i3CUo RVHIHUQjloja6R9ow9PSHHaLpF8OZykAaBGWQMYyVsYOLeyLyblp/oz/s1YoyHcC9aLD krn1wR0bs4uVqe+eJZ3+f9sQ3D4uHDfERBsKzMj7zh5TxY6RHSAlPPFdDLGZsdQhfBe2 /CEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tp/5aLTB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11-v6si4511762plz.214.2018.03.02.02.40.06; Fri, 02 Mar 2018 02:40:21 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tp/5aLTB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946327AbeCBKix (ORCPT + 99 others); Fri, 2 Mar 2018 05:38:53 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57784 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426346AbeCBKVb (ORCPT ); Fri, 2 Mar 2018 05:21:31 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180302102128euoutp01a68ab90d7e8908512048bae2ac23847d~YE0s9yMkP0667606676euoutp014 for ; Fri, 2 Mar 2018 10:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180302102128euoutp01a68ab90d7e8908512048bae2ac23847d~YE0s9yMkP0667606676euoutp014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519986088; bh=U1DSkPhUOV3TcN3eTexchfSES0W9/10qgYUG0SCVtC8=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=tp/5aLTBeLYgGY+cznUZG8TOlB7YBVJTnryrilgwpnUGRLeUoPgmXbfby7aj9g9pe RIN+6BuJ2SkCRSIUSuozow3dKa+Um2y2jmqDaraAoGr/ZiZ44nFeRkM1Ac+/ICGhzr 8xCScnHSVxIq9enhi1aP+KYceIR5n/iAKrj1lUsQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180302102126eucas1p1e12261b70a0cab041f2aeec9395da659~YE0rvV4uW0656106561eucas1p1M; Fri, 2 Mar 2018 10:21:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 1D.66.05700.6A5299A5; Fri, 2 Mar 2018 10:21:26 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180302102125eucas1p2d4575a6ae86c9c287e1c3eedde1c1f20~YE0q3SVIj0204502045eucas1p2k; Fri, 2 Mar 2018 10:21:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180302102125eusmtrp1cc82b5515250654f63410fe31f03ef22~YE0qizrsu2501325013eusmtrp1j; Fri, 2 Mar 2018 10:21:25 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-85-5a9925a6d029 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 44.6B.04178.5A5299A5; Fri, 2 Mar 2018 10:21:25 +0000 (GMT) Received: from [106.120.43.17] (unknown [106.120.43.17]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180302102124eusmtip12b5b6224137f443960e5aa3e85991bb3~YE0prfJgk3083930839eusmtip1c; Fri, 2 Mar 2018 10:21:24 +0000 (GMT) Subject: Re: [PATCH] drm/bridge/synopsys: dsi: readl_poll_timeout return value clean up To: Philippe CORNU , Archit Taneja , Laurent Pinchart , David Airlie , Brian Norris , Benjamin Gaignard , Bhumika Goyal , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Sandy Huang , Heiko Stubner , "linux-arm-kernel@lists.infradead.org" , "linux-rockchip@lists.infradead.org" Cc: Yannick FERTRE , Vincent ABRIOU , Alexandre TORGUE From: Andrzej Hajda Message-ID: <290c749a-70bf-2b74-1fb9-2de26708d001@samsung.com> Date: Fri, 2 Mar 2018 11:21:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <172e7f68-8f4b-7e5f-3e9f-7aaf10a51dc9@st.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02SfyyUcRzHfe/54aHOvk7lQ0auH1MWtbX1RFmttp6t1VKr1f1BJ89oOdk9 UWrKzlVHpd/LHQpzkmby86RMXYukhGKYYsKspitSrB+6x6Plv9fn/Xl/v9/3e/syhGKS8mQO xR7ltbHqGCXtTFbVT75eWbDUqFpVMOXDXmxulLGlA02I1RlGKFZnfUGzo+8v0WzZVxvFvh23 0exU/yeKzb6axKZeyXdkyz50UOybmiy7rW+KYPv0wxT7sv0xyZ5LPUNvxFxmcivJvUm/KOMe mN45cpkGI8X1dDyiOcv3PorrPd8g48rzT3O/TXUkZ+m4RXCDE7UEN1bmvXOuynl9JB9zKIHX BoYccI5+VtxOxtUuOF7d/AMlo07XNOTEAF4DRRUmKg05MwpciCCvsGJm+IbAXGiVScMYglTj Z/rfkUHdV1pa3EHw0XaBEBcKPIKgOD1cZ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eLO2unsIA6zQBOjxK+Hj5khWvYxSvz5eY0dpIVNQFPi7+abQLM4OHgF7CQOLhEFCbMIqEg0 fboEViIqECHRuXI+C4jNKyAocXLmEzCbU8BK4nPLRbAaZgF1iT/zLjFD2PISzVtnQ9niEree zGeawCg0C0n7LCQts5C0zELSsoCRZRWjSGppcW56brGhXnFibnFpXrpecn7uJkZgSth27Ofm HYyXNgYfYhTgYFTi4T3wcUaUEGtiWXFl7iFGCQ5mJRHelg9AId6UxMqq1KL8+KLSnNTiQ4ym QM9NZJYSTc4Hpqu8knhDU0NzC0tDc2NzYzMLJXHe8waVUUIC6YklqdmpqQWpRTB9TBycUg2M Cz4Yzt6b5BDF9fW13/70hYGrKrjMgm5f/Lf86/ETHezL5i/kKpKS+5kT5W9b88NUKdOnxVog 2uzbnkYl29llF2zkhAs6vZrdj/13vekX9OFA7oPZByNMxXmjJN/88nAysX5UeLJcyeTGvTXN Apa//+yXyDbveyBwqHi9BUeVQ8cB9n9zUySUWIozEg21mIuKEwFJ9fm1HwMAAA== X-CMS-MailID: 20180302102125eucas1p2d4575a6ae86c9c287e1c3eedde1c1f20 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180302102125eucas1p2d4575a6ae86c9c287e1c3eedde1c1f20 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180301090106epcas2p3c47f4436b0c8a31ce71cfd3909dc77ae X-RootMTR: 20180301090106epcas2p3c47f4436b0c8a31ce71cfd3909dc77ae References: <20180204213624.18288-1-philippe.cornu@st.com> <172e7f68-8f4b-7e5f-3e9f-7aaf10a51dc9@st.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.03.2018 10:00, Philippe CORNU wrote: > Hi Archit, Andrzej & Laurent, > > May I ask you please your feedback on this small patch? > Many thanks, > > Philippe :-) > > On 02/04/2018 10:36 PM, Philippe Cornu wrote: >> 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 The patch is of course correct. However I am not sure if necessary. For sure functionally it does not change anything. AFAIK kernel CodingStyle says nothing about it, so I suppose it is matter of personal taste. Anyway I can give it: Reviewed-by: Andrzej Hajda  -- Regards Andrzej >> --- >> 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 = qq(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"); >> } >>