Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2672129ybc; Mon, 18 Nov 2019 02:53:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzBjsF10smRNG2onzmRLRP3XPKDMNqz5NlJZJ06yRXuDDv1pRHjCnqUsB5HyYoCCYmyDSfl X-Received: by 2002:a17:906:4d58:: with SMTP id b24mr25539944ejv.277.1574074414927; Mon, 18 Nov 2019 02:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574074414; cv=none; d=google.com; s=arc-20160816; b=xQBVs/mFOhvTMjBp1mkH4TOG27yoQWMUIKnZD41F2XpxQOpbKhsCqSr4PjgSnZmj/B EGB+/LxoT3Lpr780g4bn9CT4OSEfM1i3MdVZQMWHA9fNgHbrWzBplmyE9znkmyRFtP1I D9BnUkMz3w9+aZ7DCPOniaES3gmlLrZmtVXDoYSHR/Z68XfS/s61mZHl2bhNQQ/pvijc li9c0dCRh60KJ8tk2v1KnZXbTU+C8eij8nkQ9Z7YOYmohSl8+L+zoMLvXM0xzbRuZc2r GI90l6CBaBQXiZHqzzQPeXc40Ua4pEtzKevqRPiKtNw9y7GgDze6MOJGjUfDfjqFfV6G XZnA== 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=a4+EWERhZOVRjntx4odjnoOZh2nSUC02uzLFe1aP9Wc=; b=JBAueKjYF1RACCFj/OYdXfzHDgm0Ukb2UQo1339PLjD1Bwflg1HWUpGfkqKBznUFhE 31EUmOcQaIfTVrzpI7TEGx4XHcrXndr3SBtLoaS/+uHMtRq4mitb1Db/m57sqrBKXbup lpEAiso0wocjNdSRvcXsTRughEfDo2l+Z3/qd8VqeSyogA49Vy7+cWBZ7GhUw183Ayd+ Qo9+znaJ0RwXnoR3gX36AzGPs86RBWO0vmv/mCITyL3ajV8hjoA0+7j8qMqCbaYOuvI6 lWMBpeOc69syY03C8T3xqjLhCAoCS8s7qKss2pu4qfloHU7H97Zkd1zYUhCIs5pjeOOy mG7Q== 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 ov27si11058617ejb.197.2019.11.18.02.53.10; Mon, 18 Nov 2019 02:53:34 -0800 (PST) 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 S1726725AbfKRKwL (ORCPT + 99 others); Mon, 18 Nov 2019 05:52:11 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:52702 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726460AbfKRKwL (ORCPT ); Mon, 18 Nov 2019 05:52:11 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 400376F20A7C1EA285CE; Mon, 18 Nov 2019 18:52:09 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 18 Nov 2019 18:51:58 +0800 From: zhengbin To: , , , , , CC: Subject: [PATCH] regulator: vexpress: Use PTR_ERR_OR_ZERO() to simplify code Date: Mon, 18 Nov 2019 18:59:22 +0800 Message-ID: <1574074762-34629-1-git-send-email-zhengbin13@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] 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/regulator/vexpress-regulator.c:78:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/regulator/vexpress-regulator.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/regulator/vexpress-regulator.c b/drivers/regulator/vexpress-regulator.c index 1235f46..5d39663 100644 --- a/drivers/regulator/vexpress-regulator.c +++ b/drivers/regulator/vexpress-regulator.c @@ -75,10 +75,7 @@ static int vexpress_regulator_probe(struct platform_device *pdev) config.of_node = pdev->dev.of_node; rdev = devm_regulator_register(&pdev->dev, desc, &config); - if (IS_ERR(rdev)) - return PTR_ERR(rdev); - - return 0; + return PTR_ERR_OR_ZERO(rdev); } static const struct of_device_id vexpress_regulator_of_match[] = { -- 2.7.4