Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1643777ybj; Wed, 6 May 2020 02:31:00 -0700 (PDT) X-Google-Smtp-Source: APiQypIR3KMu1KicUU8QHJdbL7WNRqRVwk5yivhs/b6xWlQW3nuLxkAf9VN1ojIYqp8qu4z40S19 X-Received: by 2002:a17:906:374b:: with SMTP id e11mr6741460ejc.283.1588757460302; Wed, 06 May 2020 02:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588757460; cv=none; d=google.com; s=arc-20160816; b=ubpi93ZNh95qTzCDF8fBUpJnkGJ/WFJ7PAqc7YrvTOLt2t7SX4xL+57DAxpzRPnFQg Va+KMzqVrm23F54U4H1MeoSlb43wAT5ea0Oc7Wr1KFzBAzLDFWkLBN36G4R++3qMAgBa mE7W1nkcgYKTCABl4aNv8RFNC+hkXS3r43NfnuixIZd6XhiSJZTLsW2Ts8IBCnNm6199 4ypmYU6TT3K30Pl0mP8PcHGqjGhzn2qTFqraf2z4NaTcu585f+smPaDMCCWwecwE5Pij 2Ok0Z/wOWqscmvLSWLCtG4PjrrrHT7YyGEBb4s4cZrb9d6pTmQXcxL/HM9kehfuNL8uG 3yLg== 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=v+BaT6sKFdC7EMCk+qaGZ2kgXqqDAiqD/JkkCaQYTdw=; b=rbVBFEFmuUIxPOd8JLTsSo4q+JyXnm40TaPhODcKDRtR5HzVH15pgCPE0khc+h0hVs jLCIh5GMSvoVk2nSX6ZGI200u2CxNMU/4Z9aTZSiPZmy6jm68WqbhXBCaE6JWgAc4yjc Fl7jPW75B5qLSTDA7njgtmoMlnUg6XRNefx8jIGRmimve3fEl57zQLlqzHLtDgTkpScR 8Qcz5n+YnVVZSf0vhonu57E6HD+q6ELR5rePBcZmv5P7H9X6v0ME0mMb5Y2bDXTCfIhk 1tVBDBXsv9EdtnbV5uWAgESSjPVQDT6TqnXXbX2f43Ok2LTVEBuTB8t9CngmqpUFSo/4 Tt2g== 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 da12si661284edb.439.2020.05.06.02.30.36; Wed, 06 May 2020 02:31:00 -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 S1729086AbgEFJ2D (ORCPT + 99 others); Wed, 6 May 2020 05:28:03 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:57872 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728865AbgEFJ2D (ORCPT ); Wed, 6 May 2020 05:28:03 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 138D8403536E6741DD6F; Wed, 6 May 2020 17:27:59 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 17:27:51 +0800 From: Samuel Zou To: , CC: , , Samuel Zou Subject: [PATCH -next] rtc: pcf8523: Use PTR_ERR_OR_ZERO() to simplify code Date: Wed, 6 May 2020 17:34:00 +0800 Message-ID: <1588757640-39044-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/rtc/rtc-pcf8523.c:361:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/rtc/rtc-pcf8523.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c index 47e0f41..da8889a 100644 --- a/drivers/rtc/rtc-pcf8523.c +++ b/drivers/rtc/rtc-pcf8523.c @@ -358,10 +358,8 @@ static int pcf8523_probe(struct i2c_client *client, rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME, &pcf8523_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc)) - return PTR_ERR(rtc); - return 0; + return PTR_ERR_OR_ZERO(rtc); } static const struct i2c_device_id pcf8523_id[] = { -- 2.6.2