Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3007099ybi; Sun, 26 May 2019 12:21:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHPaTXYFDIvULzEeI8i22v/OWY4rwSUivTHw5EZDbogqGFkI2TTyE1Qlui1IPolUztdk/B X-Received: by 2002:aa7:998d:: with SMTP id k13mr118643619pfh.217.1558898508999; Sun, 26 May 2019 12:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558898508; cv=none; d=google.com; s=arc-20160816; b=d1ayvB+eRlj6/+SA2tL6w0bURFO06l+O30cFWpKjgXbtzciHUSKt2mBKhiSsFRbkt3 ntYF2DcHOv+5plrTZoCEfevvnQPZ22e36ne2CsX2YX22kZW2zqjFzrEAsNfsb5hlBsAN fw4OfKDw01EcTo7IH/2GF0p8vay3AQ6cwlsgq2DHq/+E6YwZCJUjVpeVXkGIxGXF9FGn lwDqO0yKIhHwXsMbQqvBBGeZawkjFeNcAvglmARfJuuwSkkfRBTsmPDgMZfaf3QknFan 1OwiGfzNGqQEFZ9tqHJb2HQT6KqOwr22Cnx0DiDutUcFMz6F6fj+p+GXmS6nxWNQ7SRq rLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DNRwaee5QRvlTd6tUW/p0y0wvH4wHyLkwHA0a4Q76+Q=; b=x96M6jYUnDgWr10K9xGkHmDkL32NifVUWH+Rcl94K70GJ51//aqWq6A4n5i/xWbpCv idRNPtywbcvPaDqhetVPoh2dIJV5CiO8x8Gi4EV7Ee14jBaMYIvgYz0owzWYMEUrsNMu VLNpfYgkXJnuCALlde+PTFD/rZCgLsOuOgjH2XMFQNQoUHgev59OFZksvCtKIVAC6nfk Je5JvDTpcDqpYNKyPSntA0aFt8kDESP9E7YU2E/gZkKiLOoRuYPLM0952ukurUDtIFFi EZuZRj4S920iTbtvOAtEFWP2Hlj6O3pLhkawN+kyKpONMN+rKUYLYf+yQw057M7QVCwv PonQ== 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 n6si15834776pla.380.2019.05.26.12.21.34; Sun, 26 May 2019 12:21:48 -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; 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 S1727753AbfEZTT6 (ORCPT + 99 others); Sun, 26 May 2019 15:19:58 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:34029 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727086AbfEZTTy (ORCPT ); Sun, 26 May 2019 15:19:54 -0400 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 0A271240003; Sun, 26 May 2019 19:19:40 +0000 (UTC) Date: Sun, 26 May 2019 21:19:40 +0200 From: Maxime Ripard To: Hariprasad Kelam Cc: David Airlie , Daniel Vetter , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/sun4i: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190526191940.ddr2yd7szfidtiu2@flea> References: <20190525072509.GA6979@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wbyhtjebfo7bq6wk" Content-Disposition: inline In-Reply-To: <20190525072509.GA6979@hari-Inspiron-1545> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wbyhtjebfo7bq6wk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! On Sat, May 25, 2019 at 12:55:09PM +0530, Hariprasad Kelam wrote: > 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); Unfortunately, that was on purpose. It's much easier to extend if we ever need to change anything there. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --wbyhtjebfo7bq6wk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXOrmzAAKCRDj7w1vZxhR xYHIAQCHJXC7nn+WNDI2HEnEBKzcFG+IbWIX34bHIZfhK4AnGgEAgZHJJQ6EF1xn m34W2K3bjCbJ19Re4AH0OQy4fDUa5Ag= =640m -----END PGP SIGNATURE----- --wbyhtjebfo7bq6wk--