Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp361723ybr; Fri, 22 May 2020 08:21:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaVLHv7ZpLnylTQp3OZgyDJRm/F+bFW8OuLRGdZ0J2I5GCI7rc7sDvSO5Lk1Y2acmA4b0T X-Received: by 2002:a17:906:9719:: with SMTP id k25mr8970368ejx.411.1590160902713; Fri, 22 May 2020 08:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590160902; cv=none; d=google.com; s=arc-20160816; b=y3QfSTAelbVTLeeePCn3YZ6QkUpsDQiML7Pu/wHR/aiOSnJlr1jINaoHZX3Ofm2yL4 1MMmlLgPTMsX6lwAzlZXwapM8I/e2MfpvxInUMBrtn+/VC96HhUqtnDh8bmf6grH9EWC COTPUfn98FbVNuoExIyDvBSWhAqCGbivVcZGmYbuYKpCYku+gz40Z7LJPE6jSp1WUuXf jNq5fPjBZHiAhUCMAx7PsdNxFUIHoa11qngr7KhFNgrJ11F2bElVsk0WNhzW5e5oArAV cP79jfQQPGfXoD7/w1v7Yn0XVcucQzb9aNR3QGPZeaDipKUQxNOzIBaai5UILebGCJYy BrQg== 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:dkim-signature; bh=EolA5srIbCcxGMmHLVcKyXxlyyI06IE0n5WOLtim84w=; b=YnSGAH5w2sv+b1LEzfFRlrpxd5EeSaExlE9kR0csYSXJQeJvrd0lXvXAnlsl3NIupw Ogju2CCtSnng1peqe8o5yDU1zPX17JRRcoXWVKRPDE1Fn7RMPjCHbh2GuIw5vLEcUy2b DSomoGALi8++sttxsHzCVS/pItfRaIbC1etBqUWE8BYzeT79hLBqFaYQn5nrdt6DQItE 1b8IDXOUv15Zxadsj1VoTuQWoPAM/OVC6grGJNC3+gXqTY1KiBSLx7ovnsP1/+KLCF9R UzqC0X6OENsLtLhd28As9MMpk61Q9anLvbpeNY1Gw/8lFBrgfvxQYvs5ocTJMnGBcesz Fjkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HM1hY9e/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si4726758edp.481.2020.05.22.08.21.18; Fri, 22 May 2020 08:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HM1hY9e/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730316AbgEVPRQ (ORCPT + 99 others); Fri, 22 May 2020 11:17:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730243AbgEVPRO (ORCPT ); Fri, 22 May 2020 11:17:14 -0400 Received: from localhost (p5486cea4.dip0.t-ipconnect.de [84.134.206.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A91DB205CB; Fri, 22 May 2020 15:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590160633; bh=OSAiuH/ltMwuwK+9Fk2bcyYZOPSo8Z3O972mx+bTBjc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HM1hY9e/VlAz9831LjvNbqYC+AlRn+FQUXfSY0nCMnOaAupxW/6xQRDHUmYfarHDu MNF1i3y/bKPsQ4CuUXldhVrAkogXnRW5pBfL6mZdc5bij0j72E+mR0UnAyFixiTKQ2 wj0RakOAUWmrSQ79dEkWvmfuGpeB1EMN3jrSIEqc= Date: Fri, 22 May 2020 17:17:10 +0200 From: Wolfram Sang To: Aishwarya Ramakrishnan Cc: Ajay Gupta , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: nvidia-gpu: Use PTR_ERR_OR_ZERO() to simplify code Message-ID: <20200522151710.GL5670@ninjato> References: <20200505145230.17251-1-aishwaryarj100@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qo7zVO9a9OQ5oQtr" Content-Disposition: inline In-Reply-To: <20200505145230.17251-1-aishwaryarj100@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qo7zVO9a9OQ5oQtr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 05, 2020 at 08:22:30PM +0530, Aishwarya Ramakrishnan wrote: > PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. >=20 > Generated by: scripts/coccinelle/api/ptr_ret.cocci >=20 > Signed-off-by: Aishwarya Ramakrishnan Waiting for the Rev-by from Ajay (driver maintainer). > --- > drivers/i2c/busses/i2c-nvidia-gpu.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) >=20 > diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c= -nvidia-gpu.c > index f5d25ce00f03..f480105000b8 100644 > --- a/drivers/i2c/busses/i2c-nvidia-gpu.c > +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c > @@ -277,10 +277,7 @@ static int gpu_populate_client(struct gpu_i2c_dev *i= 2cd, int irq) > i2cd->gpu_ccgx_ucsi->irq =3D irq; > i2cd->gpu_ccgx_ucsi->properties =3D ccgx_props; > i2cd->ccgx_client =3D i2c_new_client_device(&i2cd->adapter, i2cd->gpu_c= cgx_ucsi); > - if (IS_ERR(i2cd->ccgx_client)) > - return PTR_ERR(i2cd->ccgx_client); > - > - return 0; > + return PTR_ERR_OR_ZERO(i2cd->ccgx_client); > } > =20 > static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_i= d *id) > --=20 > 2.17.1 >=20 --qo7zVO9a9OQ5oQtr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl7H7PYACgkQFA3kzBSg Kbb02xAAqw5yE3PD2uDXw4UCsq8wYIx0jsn98zARm06rV+I+G0x2PkgvL04ylS+h IS+iee7cOD4O+RQ2UphiFHEufuZlSclyWS82EQ4tceauFAIthIKOxOSm6HcBfzhC oKK6mQAk92ZMobR1ejAZk+wCHqk6PVcSCiAZbQEHU1OQwwXwqXHDyCn01BtOvymJ EX6ZP+m26jBLM3hl/SyuILz8pScwWYY2RgTchmQZuKgod8OJoO1lfn+/dGP+pms3 CX2u79xSF2a4W5Tw/HeRf1p7VcVI+5qbMvKUZYmjkg0Im3ybq3IhdpHrhSZrmrAt 2g+dc72F5lqMHtYzxPif3jcHo1udVFHFPuYOpOJbd8LCHGHq3k79RxisYEjO51yx /8zNwZYDPvrY2e/zfj9nrPqmrbpkNVWWRfMCUBaGSYuPJxwph9/KI8nYYrQI3VtO VhXCcWN1n4ibOLOKYdQZMBjGGq+vvIZrgxNeMbBUA8Ua1jAmCCsFBBwlXsvPlGNK KoNh3ZeD/v47VIh/h12O9tRqT74VbdaltxngfRst2Yirw4+X/zXaYJJYtDREfU/S b7wRQtwTp7kyOww1GN9vk9Rrj8n311Nb2vTmX1vgr6Fje6SNr2OIILCRoOWP4gUx yg2yELWnuTpR5fJmlU8nzwPuzDosUJDLMMknTe4bGuqw4Df9mfA= =uAFd -----END PGP SIGNATURE----- --qo7zVO9a9OQ5oQtr--