Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1380760ybi; Sat, 25 May 2019 00:27:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0WKr9IpMIAz/xwPy5fbCwr3sxYJBM8kIzOZ8+7Myjz7i856VliZNF3WpSpxHedYHhXtqI X-Received: by 2002:a63:e50c:: with SMTP id r12mr96004717pgh.284.1558769249620; Sat, 25 May 2019 00:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558769249; cv=none; d=google.com; s=arc-20160816; b=HgXCWmhn5lk4lZN6fBs3DcMZbQo2ZjXRBiW6bs4qH3WIG5gJBAifx+cMWwwU6/pcfY /drE98gFpDIOGrXtwcVC7VLezLJJLgxaeKVaroBKS7vcWPz2wjZLHDgVlgchdJg+i8fF /75Swq5AeUHcOQVSeK25In1B1VB1p8XkTaVRWaQkLzw+8j0fvo0y0dVKkroWkq4GggFi Y2fX+a8Pn1j7Z13FuVNe9RwT5c63pSbkbRBK5ojobtlOdv9dLSbCEUjxKs17OBhGREvS km1rOdGUOLeegJw3JkvWVmS9vZbcG64wZf/ZGuAcEsgBHI2deYznE7tEF8H5YHH1b9GJ 3CqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=3/HXmCveeAbDHijcuKaxjc8S8ha3SNVf6PI9wjQHBaU=; b=hzSAH0Vwc/rfZK0X4aN+5zpbpAhNNzu6Mtn8OX0u1wKlrpWD3GTi7hvZzAEcf74EwF HucEtvfseJ6BSD1duiboXOYV+arNq8VJmhFQQhvDEcgJMXqGcPfL2gc5RY4kBvRxVWqm xhkUa1KKd+AmYZGi97YLMaPwNTxFC6XirJ4rtjZPT7kMf3nmdtZJR9c/P8yQWqhTO4xI rz5Xs6CVOSWeTccgr14j8AakgdHM182hSGjvgRn9Vj+2B5FSJPIRcJiWu45OIh48NGei dX5BjkxkgAjdLFcPjAj2MUoqc4/sK/BQ0B5xIMgRgCBFtyv4TrJ5Pdhcajpg82qS5W79 Vr8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iJGtl5if; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si6930494pgr.22.2019.05.25.00.27.04; Sat, 25 May 2019 00:27:29 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=iJGtl5if; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfEYHZP (ORCPT + 99 others); Sat, 25 May 2019 03:25:15 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46022 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbfEYHZP (ORCPT ); Sat, 25 May 2019 03:25:15 -0400 Received: by mail-pg1-f194.google.com with SMTP id w34so1591823pga.12 for ; Sat, 25 May 2019 00:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=3/HXmCveeAbDHijcuKaxjc8S8ha3SNVf6PI9wjQHBaU=; b=iJGtl5ifVwJd8BjCR93hGbqtuqBchM1RWraUzeQUQoQ2O9vIRPkkaX9QRvxuuCr4Uc nQD2tWFlXUVRN+Qig2B3ShbJzo1YM4FdaCl3vEoU2LA25xV4K3POmnQM9RLw3b0RVF4L oC+iDk+pdJfldY2GLBfZhy6+jAuqsoLK8koBh0lwLGgX0CQz3ZtsocUEk6RDP1PhizlR D2Mg+l5vVefIdCFCLeGSphk4tzW+C2r3SUjG5HPYmk+YIiuBSH7BYAhJHnTW+H/57C6h n+b5SXSTPcPntvqtNyhhfOYSjTfMXxC3jqx+oiQ4RlfO5u9nPu6z+m9AZvq7IBWtgNIo 1Wcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=3/HXmCveeAbDHijcuKaxjc8S8ha3SNVf6PI9wjQHBaU=; b=MymIF3zzPUb/u9+XS0qXX5IPpGFs3R9ZLk6zPyZZUefc3iJaiK1pheoiNf0HWP5frb EEPUc+2VlWnQ7iajoIduQaCd05x7M6c7Q6W0WhQNA5EPaxozSCnkpoLD3ES68ILA8o4N vm8/PQoArZ9WPdyXIjmSpbV016Gq/e5DMsF9tnkTF6VaTtAmLetdC6m0ry/od/6Kq/vd 0GHGBH2mD37EuEPezQfhg0EEXs/jwKWYE0rJTcJwq/czzunK0N7JD//Opcqlu3S3uExy fgLN/qOOpvOCcLOoXfz/rlEWVep3WTRupAuQD19q+UUXlH/7/zxePa5O2iTMpP1gBzfq 6CBg== X-Gm-Message-State: APjAAAXuRSnKcB5Zkra2NIDC83nQOnX1VB3nY1a+lNnB28LTOsn1P4fx k2MOPlpkBawTCFo5t4T4lYQ= X-Received: by 2002:a65:4349:: with SMTP id k9mr22299168pgq.243.1558769114822; Sat, 25 May 2019 00:25:14 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id w12sm3997009pgp.51.2019.05.25.00.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 00:25:14 -0700 (PDT) Date: Sat, 25 May 2019 12:55:09 +0530 From: Hariprasad Kelam To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/sun4i: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190525072509.GA6979@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix below warnings reported by coccicheck ./drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c:174:1-3: WARNING: PTR_ERR_OR_ZERO can be used ./drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:236:1-3: WARNING: PTR_ERR_OR_ZERO can be used ./drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:285:1-3: WARNING: PTR_ERR_OR_ZERO can be used ./drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:142:1-3: WARNING: PTR_ERR_OR_ZERO can be used ./drivers/gpu/drm/sun4i/sun4i_dotclock.c:198:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Hariprasad Kelam --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 4 +--- drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 4 +--- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 4 +--- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 4 +--- drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c index 2a15f2f..e0fd19d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c @@ -195,10 +195,8 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon) dclk->hw.init = &init; tcon->dclk = clk_register(dev, &dclk->hw); - if (IS_ERR(tcon->dclk)) - return PTR_ERR(tcon->dclk); - return 0; + return PTR_ERR_OR_ZERO(tcon->dclk); } EXPORT_SYMBOL(sun4i_dclk_create); diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c index e826da3..1e74040 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c @@ -139,8 +139,6 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent) ddc->m_offset = hdmi->variant->ddc_clk_m_offset; hdmi->ddc_clk = devm_clk_register(hdmi->dev, &ddc->hw); - if (IS_ERR(hdmi->ddc_clk)) - return PTR_ERR(hdmi->ddc_clk); - return 0; + return PTR_ERR_OR_ZERO(hdmi->ddc_clk); } diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c index 58e9d37..b72f9c7 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c @@ -282,10 +282,8 @@ static int sun4i_hdmi_init_regmap_fields(struct sun4i_hdmi *hdmi) hdmi->field_ddc_sck_en = devm_regmap_field_alloc(hdmi->dev, hdmi->regmap, hdmi->variant->field_ddc_sck_en); - if (IS_ERR(hdmi->field_ddc_sck_en)) - return PTR_ERR(hdmi->field_ddc_sck_en); - return 0; + return PTR_ERR_OR_ZERO(hdmi->field_ddc_sck_en); } int sun4i_hdmi_i2c_create(struct device *dev, struct sun4i_hdmi *hdmi) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c index 2598741..389c1c5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c @@ -233,8 +233,6 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi) tmds->div_offset = hdmi->variant->tmds_clk_div_offset; hdmi->tmds_clk = devm_clk_register(hdmi->dev, &tmds->hw); - if (IS_ERR(hdmi->tmds_clk)) - return PTR_ERR(hdmi->tmds_clk); - return 0; + return PTR_ERR_OR_ZERO(hdmi->tmds_clk); } diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c index a4d31fe..d52f581 100644 --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c @@ -171,8 +171,6 @@ int sun8i_phy_clk_create(struct sun8i_hdmi_phy *phy, struct device *dev, priv->hw.init = &init; phy->clk_phy = devm_clk_register(dev, &priv->hw); - if (IS_ERR(phy->clk_phy)) - return PTR_ERR(phy->clk_phy); - return 0; + return PTR_ERR_OR_ZERO(phy->clk_phy); } -- 2.7.4