Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1619078ybj; Wed, 6 May 2020 01:59:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJPw7OWU2zeWe9SJ1DO1AcX0qbiUgu9rX3HoJLhyogWQljl5ikc+336mRky34Hh2Z4g4m66 X-Received: by 2002:a17:906:e01:: with SMTP id l1mr6343607eji.76.1588755563603; Wed, 06 May 2020 01:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588755563; cv=none; d=google.com; s=arc-20160816; b=sYRYY5N4vzbZ8O9TwDTqWJEEXD3YCFCIdw05kUFT6x9vIt8xXQkmE5fxQCk8RavqSW Dl8Lk5lwXCBtvCI90cJ14JMQv1RUbyQ5C7rfmdYfwQhSNlOTzuHa8lwYHO2JJv7LLsAp osqXPbqVhM3aYLXIfsO2nCi/DzZKfz0h0mBne7sk48CNR7twpqLJC0JN1jXvo0YnufYn r9mtamPwLk4RMuKzkVIPkI6tdTLiP18FJlJuHT5r8oRxPMusXiWlzHaWm8+0CQTwInRR Up+vbbq4dF9lsKTyUylwku6WaIpFaVLDWYKdbvlowj/dbgXwO8GYi/yL3G9hoZ8pCRdv AkJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=aqMztf+pma+LaCLPir4dx2LBmRaqGMsvSjlntA5XrBk=; b=xzZgRnitto4gHOuSqwljlCYu3DfIQeBbQkM4rdPDK/flfUKTzd/MB4376tM6MDfI3a J31W+/HHUgQOKuUpu5I6L1XAC0SIe+IcWzLdA4PAlOx5yRA3dZOBNyHC/wVJuJTJFgnr yAuLWI+GSgh/VBZ7laENuH0Z0rWSAUzYes4FE+aOXcz6T5I3Pp0XDd1tQhFTCa/BojAa Gm6Sql7yQE/LGKbhBstm/0a2qr1W3GtVxVd0ZhYFMWxjuoH5CNHVlGt3rxiHMGfn/cZg TUWRUWn8xUHt508Mx50q2xjAL1ZINUOmrkfcQQpvS6VNeDprYOzFkUZqcTUXB317HbTA F4NQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si658073edq.472.2020.05.06.01.59.00; Wed, 06 May 2020 01:59:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728780AbgEFIzN (ORCPT + 99 others); Wed, 6 May 2020 04:55:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3816 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726935AbgEFIzN (ORCPT ); Wed, 6 May 2020 04:55:13 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E0B60D0BB59F771AB944; Wed, 6 May 2020 16:55:09 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 16:54:59 +0800 From: Samuel Zou To: CC: , , Samuel Zou Subject: [PATCH -next] i2c: nvidia-gpu: Use PTR_ERR_OR_ZERO() to simplify code Date: Wed, 6 May 2020 17:01:10 +0800 Message-ID: <1588755670-38476-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes coccicheck warning: drivers/i2c/busses/i2c-nvidia-gpu.c:280:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/i2c/busses/i2c-nvidia-gpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c index f5d25ce..dba5d11 100644 --- a/drivers/i2c/busses/i2c-nvidia-gpu.c +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c @@ -277,10 +277,8 @@ 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.6.2