Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp810906ybj; Tue, 5 May 2020 07:54:28 -0700 (PDT) X-Google-Smtp-Source: APiQypKt0LnJUXm/3gokcTS93D22zBSkACbx6NM+lviwNiL+rfy0RTe8+v2K0kOnkwI8hyjvjUp8 X-Received: by 2002:a17:906:1d13:: with SMTP id n19mr2905462ejh.287.1588690468334; Tue, 05 May 2020 07:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588690468; cv=none; d=google.com; s=arc-20160816; b=IvwV7mVZJMuf7JSzn7pDo9yYhcWak2CMd6YGf49trSLGC+Gom+6NLYiTHDFNQfHkU7 W4dbT1TKuKldjhw/43/TP5G8cNdSmTs8T72UHPDOHqOB51M04+dtpY1vgF4p3PFjrALT dgoPLPHDzI/p3vrU9Zfb3dlp1T80forQ8NJebGeERfhm8QXO9Xkr1nCrJIWp5RiZkfCO BvJeWH+1TXxDZwHmxYgPm6DDgLNy2bv26mMLj63Pt1UVx1x7U28qz+eiiGmNNAGehWHK uiybjMg5hG4Jw/5CYoeTDAgIUHIcC7Zd4cYi8bas/JxjCByFi7ZNA5y7m+BvsxjBnDV4 sURA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=qeWqebBHbrz9NQE1LcRIuA9aTCykR2qMhUZdHa+RvL0=; b=FsuznfhWUlgaRShG5kcyPYCIyYKcSY4mMQk52FNGpKGsOeOVx8sM+TTkETAYsycWD7 +ay+up9Jr9n312zjzlNLrVJ4ClwXvgEiaEpH/UVlmI4ZEb9S3ZbdCA8jAFQOEF8A6FIe aniEr+6AgkPtYJTeJPj6DHUpgrLhLTUDpiktu9YXH8h3uhrsZzixqWeKH/jykZdQgxqb 9aCQ/rhLwwxPNL5y96SvuZ//pQpwGxfdHlhNCNCI5/rBrrUrBz5oZpLW1ODN/iHYOQv4 e8glkrbsj5Qx37JzaCCT/pnBZ6A1/3G8u+fC54Nf1Y1UDZvrKM7PTv/hWjVOTxrAX2bg qfSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fjUIqMr+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk9si1384104edb.403.2020.05.05.07.54.05; Tue, 05 May 2020 07:54:28 -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=@gmail.com header.s=20161025 header.b=fjUIqMr+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729412AbgEEOwl (ORCPT + 99 others); Tue, 5 May 2020 10:52:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729247AbgEEOwl (ORCPT ); Tue, 5 May 2020 10:52:41 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E51C061A0F; Tue, 5 May 2020 07:52:41 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id ms17so1202637pjb.0; Tue, 05 May 2020 07:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qeWqebBHbrz9NQE1LcRIuA9aTCykR2qMhUZdHa+RvL0=; b=fjUIqMr+zGxzzUUBgAEuYYK9aZncUkkyFdarjhMrNGCgOunWKLZeSIhCtRXw99thdD oiyjjFE+DRHnFQhUkWg+iK3KFLZDVF5n9ZpdOpIjwy6mpoSU130fSMdRgIe0f3R35UWX f4CAADXAst1CY/ucuPMN2nfq0ldp/bIGdCfsVI6TCNfVuB0PmMLQp/KgDeHvuYoPBYKW EwX94ySVNV/XPu4GCgbuhp/qpxni/sIaBWn1x765W6uubdhKpVSIGVtWVWzphKgXeQli E36Vi/5qUqFHu4xnRTENDoPNpeHC71anz7MYoQ4EpPWz9UvX59IacPvIWcrUnB0n+YR+ Pk6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qeWqebBHbrz9NQE1LcRIuA9aTCykR2qMhUZdHa+RvL0=; b=B7fNtFAHTVOZlJhjXG45SG3vxFopZ/w3Mj3fscrCW0jO0ayD83Z/+HLeaQ9pOk8ou4 fVnDlB1SDEUCLfKJ+wN/SkIDwaUzDo0Zf6uf1DDvimvnUqP5AfzaFxaExGOzbyc/yHfh +3FycyaFNBfBXX2pJf8hS1EPWKg4yekQF2/rcoDWR4vwRqnAoaS7J2q1CFAvAbYDswy5 qvOJJ8ll/8VqanpeGD+QcOjGcEdOiRlJONbjufpxzFLVBmrFeWcQ1kKNSDK/+5s76XZC yMNBywgdB0lApKdzV9YIHMjGVtUBYDLENgJ4RuR83t4JItflCA91HIUUOk8AfDPsynKJ XD+A== X-Gm-Message-State: AGi0PubZPGsQCSRzq5ktaKMyyLNgtubMUqUufgRqOCE7lg8e6xXXmvkp lQF2I/K8OgTK3Dh7QTwfzD7d956G+XU= X-Received: by 2002:a17:90a:ad02:: with SMTP id r2mr3597818pjq.63.1588690360880; Tue, 05 May 2020 07:52:40 -0700 (PDT) Received: from localhost.localdomain ([2409:4072:60b:fcd9:7c28:bcca:10e4:5523]) by smtp.gmail.com with ESMTPSA id d2sm2249630pfc.7.2020.05.05.07.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 07:52:40 -0700 (PDT) From: Aishwarya Ramakrishnan To: Ajay Gupta , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: aishwaryarj100@gmail.com Subject: [PATCH] i2c: nvidia-gpu: Use PTR_ERR_OR_ZERO() to simplify code Date: Tue, 5 May 2020 20:22:30 +0530 Message-Id: <20200505145230.17251-1-aishwaryarj100@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Aishwarya Ramakrishnan --- drivers/i2c/busses/i2c-nvidia-gpu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 *i2cd, int irq) i2cd->gpu_ccgx_ucsi->irq = irq; i2cd->gpu_ccgx_ucsi->properties = ccgx_props; i2cd->ccgx_client = i2c_new_client_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); - if (IS_ERR(i2cd->ccgx_client)) - return PTR_ERR(i2cd->ccgx_client); - - return 0; + return PTR_ERR_OR_ZERO(i2cd->ccgx_client); } static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id) -- 2.17.1