Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3982297imm; Tue, 11 Sep 2018 05:16:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQ4GAPwqJHH8KPVG1bP4OJV/L6qzSzPiBP1nB0ca6HeE8Csx5i8VUaivhKk6ya2m0zprQX X-Received: by 2002:a63:d518:: with SMTP id c24-v6mr26843952pgg.357.1536668197773; Tue, 11 Sep 2018 05:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536668197; cv=none; d=google.com; s=arc-20160816; b=Ab5UK1TvvWWkywSFO+BhyUlgvu2ImougJxpc0AmcZAzW4K6I5J7mUbz/G/J1ATYJqO ZpAHnOWUk7B4sI/RhatO8w9c7wN3tf0N0bE5v5OVW2ItiwP9MmNj6r7bOSRAr/g8I2D7 yC5mRXNM9Yhb1t6TNrzbW7hNpyJ8TYpN8AhjxmPMMhcTjmY63XuvK8Xu4pPM6I4iq4K1 g6eR6BESKucbn5kbY4Uz5HvaiE24AgdhFFAAPwfziNsgOgYBBDP3iBEi8qsPu8W0qQGo vyj2HPF9zQycyH51KzeCXwfGmTq8PHG4WOKpAQzFpEn4++ChbFUhdVkprWvPK1SmOadr N8tw== 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=/HHy6TkemzU/ziseOj6VAn2s/lGy/Wo6nrTTqeNmGh0=; b=rBRxiPmKElRbwlkkCAh28ANi55iVCZF9+KplpLtOGIOx6hU0GHuS3oGBCP+Em9f6Q2 F1gCbRr44Hy2Azu55lX97+WlG41oigK2gpsJaPWDOVd6l4XPbBD3yxdNVXMTB1h4XJya J5xm7JNDJ50m/dkKm+2AKV3eK2uRS/r1Hknu/uzVJuBHK92ai0msECW66N1PiyfZZOUi 3e0CYKGzgA20og6C34s3jiFv5RPdP572Ysea6fkJtku83T1ykK/uezz+3a52HVGCScro SVm4lAHxyG3owZ1xx+IKRbSJ9h6MA/ePYH3Z9QWOXrA2T1lrswgzU33k4slYc9Nki0R9 VGyw== 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 b15-v6si19127489plk.111.2018.09.11.05.16.12; Tue, 11 Sep 2018 05:16:37 -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 S1727755AbeIKRPC (ORCPT + 99 others); Tue, 11 Sep 2018 13:15:02 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12095 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726647AbeIKRPB (ORCPT ); Tue, 11 Sep 2018 13:15:01 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C51A74AE5E6A1; Tue, 11 Sep 2018 20:15:54 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Tue, 11 Sep 2018 20:15:51 +0800 From: zhong jiang To: , , CC: , Subject: [PATCH] hwmon: Use PTR_ERR_OR_ZERO instead of reimplementing its function Date: Tue, 11 Sep 2018 20:03:37 +0800 Message-ID: <1536667417-11718-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 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 has implemented the same function. We prefer to use inlined function rather than code-opened implementation. Signed-off-by: zhong jiang --- drivers/hwmon/asus_atk0110.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index a6636fe..a7cf008 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -1210,10 +1210,8 @@ static int atk_register_hwmon(struct atk_data *data) data->hwmon_dev = hwmon_device_register_with_groups(dev, "atk0110", data, data->attr_groups); - if (IS_ERR(data->hwmon_dev)) - return PTR_ERR(data->hwmon_dev); - return 0; + return PTR_ERR_OR_ZERO(data->hwmon_dev); } static int atk_probe_if(struct atk_data *data) -- 1.7.12.4