Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3037508pxu; Mon, 14 Dec 2020 18:48:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYxXKkA9LXCVJRxoEOmqLqkWfOcXpQ4hqikmCnTknrJF71Z7pAs19G1uAaO9t37WaxbyqE X-Received: by 2002:a17:906:1955:: with SMTP id b21mr24961466eje.236.1608000481516; Mon, 14 Dec 2020 18:48:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608000481; cv=none; d=google.com; s=arc-20160816; b=LkJd42+VXP+ukd6tiFQFNmAHw33eJ9R0iWkIjulLcnRW5mw8gIvgnPuxkkqeUV+SSs 55urytk89lajoKa111HkwQcwnQVpencq4ESwZC1mqpRqluiFVnK93TODvTqPXPIOcf4u 3u9XfokmmzOObNg9PEb3fPYCzcxrzTurVAeBS1O5qKIFYcLiSEr9e+Y7gwZHzwbsYnca mmEIyRG/9wRePwYrXYIIu7ejQLXyFKYwQ8+m2MTbqa1eu78V8ewVixG+Wl7E6MjPprPK 7FS0l8IuQWp1ITv+Q0Vrf4uHIDWM3MrH2ghzSPQaR0zvEkaj6Jv2P04qSQmKDv4aGVpi wlxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=fbM/z0h7FPejKBsNtS8BH/7eB8m5gyxBFxWt6KaPZJo=; b=Few6JfzWfZ6ZTntGFspmuO17u0hgB0zQqBehSi8R7YN9bxvr86nNEOXs/MDV6bwCCy EV1RGnXBghXcEREgeRDvIEVam32//3yui+WqQhRruKK6M+1MkY//SFHzLhw3iNlwzrBH EzN9L4BwSyGBoS/VBPZuLuLLgmMGSz/p0nfiUxaa3JAywi70Xq9J5SDHamZsY9UImezz WHhLbyhHLRgUD0SABfwKwSV8ZBlhEZ6RS3x4IYWW45Jv+WxVc3Glup18AHX3641361Jk XiVVf+jWCdJSdmR3Elc9OUcp9mPEFJFuOrREOeQ9t4t3mqG9hHfObbqVeDi5pXLTOOp1 9THg== 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 r14si210225eju.173.2020.12.14.18.47.38; Mon, 14 Dec 2020 18:48:01 -0800 (PST) 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 S1726847AbgLOCSE (ORCPT + 99 others); Mon, 14 Dec 2020 21:18:04 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:9887 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgLOCQt (ORCPT ); Mon, 14 Dec 2020 21:16:49 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Cw20f10jMz7DLk; Tue, 15 Dec 2020 10:15:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 15 Dec 2020 10:16:02 +0800 From: Tian Tao To: , , , , CC: , , Subject: [PATCH] drm/sun4i: hdmi: Use PTR_ERR_OR_ZERO() to simplify code Date: Tue, 15 Dec 2020 10:16:11 +0800 Message-ID: <1607998571-59729-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes coccicheck warning: drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:281:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Tian Tao --- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c index b66fa27..12a7b7b 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c @@ -278,10 +278,8 @@ static int sun4i_hdmi_init_regmap_fields(struct sun4i_hdmi *hdmi) hdmi->field_ddc_sck_en = devm_regmap_field_alloc(hdmi->dev, hdmi->regmap, hdmi->variant->field_ddc_sck_en); - if (IS_ERR(hdmi->field_ddc_sck_en)) - return PTR_ERR(hdmi->field_ddc_sck_en); - return 0; + return PTR_ERR_OR_ZERO(hdmi->field_ddc_sck_en); } int sun4i_hdmi_i2c_create(struct device *dev, struct sun4i_hdmi *hdmi) -- 2.7.4