Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp481306ybe; Thu, 5 Sep 2019 00:38:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqypmYiQ5SH0PZ2miefATL2NfEQTHSntymMzbgNG/lw0WcmrtX7+oDkK2m2qnP9/hz/EFGDN X-Received: by 2002:aa7:8c03:: with SMTP id c3mr2094865pfd.139.1567669121022; Thu, 05 Sep 2019 00:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567669121; cv=none; d=google.com; s=arc-20160816; b=pnRF/fCWskty48lo7xFiRN+DC63OExYUoX6PrimFIzsEHwqs5QnWrdtuiU+6ljLTdz qGRCD+r6gQGI6c0etKMWkxy1Eejg3aPMV6bq5O+tq0GQ6c22ISxTDrx4IJ1V5dswLyOF pJq8S5NjvxXtW+MLEbgUPpLxiKq+wp3nhef8Qb8AG4PGOxvErHUXop+qpG868FM9Yjfz +GS9zvas9FScYZPZ36Nx2isat1icP7fixTCqq/+Y1KY92tJB1D3bHc3obyUyD+ZyxZzg u4ZEbTG4sCIKNGfTQlxNmN3HYNCA3M+vdnSEjqEWUQWSyJI72wuPMX24YcSfyZf7PbyX Y9YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=5x4sVC846svcpQtI2ReDI3VsiyBaX3gNDW6HoONoLhE=; b=tT7S7bUwdOQ0r/W1dmdBTX0xjTLJ/kP4LYIZXtxmmcsDsAJQ96Jpgb9GlC9+U83Mr7 fLcvHj/Fr+2RRUqb1AGj8oDybOaVgvC7wsq9JE1A3YkCVsGsuT6eRT+GRC77GEnUjbgw FgRErWQNvGzs/AjjJYT5klFqSKsw/+NzV2ah1sTgTSExFKaVGs+SRf1Uc09+I5vy9zqU qM7nJWy+qjGtscPQI/Ysx3hps+QbmUyCZte3CIry4sqddGnucjOKuN1y5p1IG6oL6koh AX7/+F/2Ynj3zXTqqHqDpqoXTBrSA0vuFfBQjzzQvT8qLQh7qEGcpojG4lE7QOs7s7cv cKLg== 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 z11si1280357plo.64.2019.09.05.00.38.25; Thu, 05 Sep 2019 00:38:41 -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 S1731008AbfIEGqX (ORCPT + 99 others); Thu, 5 Sep 2019 02:46:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6677 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725290AbfIEGqX (ORCPT ); Thu, 5 Sep 2019 02:46:23 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 752D65998B31670E5797; Thu, 5 Sep 2019 14:46:21 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 14:46:14 +0800 From: zhong jiang To: , , , , , , , CC: , , , , Subject: [PATCH 4/4] rtc: ds1347: Use PTR_ERR_OR_ZERO rather than its implementation Date: Thu, 5 Sep 2019 14:43:15 +0800 Message-ID: <1567665795-5901-5-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1567665795-5901-1-git-send-email-zhongjiang@huawei.com> References: <1567665795-5901-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected 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. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/rtc/rtc-ds1347.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c index d392a7b..5a64eea 100644 --- a/drivers/rtc/rtc-ds1347.c +++ b/drivers/rtc/rtc-ds1347.c @@ -151,10 +151,7 @@ static int ds1347_probe(struct spi_device *spi) rtc = devm_rtc_device_register(&spi->dev, "ds1347", &ds1347_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc)) - return PTR_ERR(rtc); - - return 0; + return PTR_ERR_OR_ZERO(rtc); } static struct spi_driver ds1347_driver = { -- 1.7.12.4