From patchwork Thu Mar 30 08:49:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng <15330273260@189.cn> X-Patchwork-Id: 76968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp975695vqo; Thu, 30 Mar 2023 01:51:21 -0700 (PDT) X-Google-Smtp-Source: AKy350a+AY6BgWKjZn9o7TBJ5WcjwGRZxVbCAGBjspK5ZLGivTSjXV1DXlPABjTE85TgFU6bJZO2 X-Received: by 2002:a17:907:3fa3:b0:93d:425a:b935 with SMTP id hr35-20020a1709073fa300b0093d425ab935mr27678581ejc.25.1680166281770; Thu, 30 Mar 2023 01:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680166281; cv=none; d=google.com; s=arc-20160816; b=0E9NKii/NmgvRhH7/55SF8885qnVlUWlGYOWC1LQ8YTAPJ9rAXZAVhv6SyfBejp3YC Fivn7Ekad5qFr6T3Xo/MKhAxBlr+PDPETjWSM581/yklAsxf4nJf23qfPOqoCttOQPtE pbX1iuaJyaN+jCMfDHZu/SOyHIEl2+YG/uT1F3Jz7PZVylMG80NEj+qqVlkm441Ejb8n gAJhHNGnMfeGBKm+3jje3H+F/YVOSjazwWAxqdgPPXRRUV4cEKBkDZhkoR5GDu1aUSIA DGGnBgnlRsNo9PFAAngeseM42NhgC1EyJaiXbG0akKhBADIcE4+gXo6pxXmRtMZdA+bq m1DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :hmm_source_type:hmm_attache_num:hmm_source_ip; bh=GY8UzEvjhJf4K+oJy8gUkH/2bIAPNHPcBmtPCA0rcnE=; b=G+G7WitkgPnSBeMpd76fwd7lrIEzKe9qhHEPBy/t+zH5KNmHXCPxpN9uisi4xEoFOs g/wUrrYeQ41NcVkWD7D7oluDJz8lVV5qKFrYkxhJ9rX2/X53FYrGkqvdQhYrZbJ4QrD9 hND/Lv+ESje95vVZ6rYhzpy41rpztYARFanz59XUDgD0vWo6vt7zC5MZZXgL8ay1jzKZ d9+u+0E/6or14hhRlzvty9BDP4fogxygU5cega2dNBKvhJIl8HGdn3FuQoaHFGL8eA42 5p4ksUBOy2oYyD/RBgKCHEdiZ6e136CvNX6i+Bzv77UuRyR9+6QlKSLUyY3RyQZcf+PH OLjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb7-20020a1709076d8700b00946fa685ba8si42716ejc.511.2023.03.30.01.50.57; Thu, 30 Mar 2023 01:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjC3Itf (ORCPT + 99 others); Thu, 30 Mar 2023 04:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjC3It1 (ORCPT ); Thu, 30 Mar 2023 04:49:27 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 72DC36EBD; Thu, 30 Mar 2023 01:49:23 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.41:44746.1405145320 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-114.242.206.180 (unknown [10.64.8.41]) by 189.cn (HERMES) with SMTP id B21471002EE; Thu, 30 Mar 2023 16:49:21 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-7b48884fd-ljp89 with ESMTP id 14a233d3256440669eb13540df3b3627 for maarten.lankhorst@linux.intel.com; Thu, 30 Mar 2023 16:49:22 CST X-Transaction-ID: 14a233d3256440669eb13540df3b3627 X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 Sender: 15330273260@189.cn From: Sui Jingfeng <15330273260@189.cn> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , suijingfeng , Sumit Semwal , Christian Koenig Cc: nathan@kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH 2/3] drm/drm_gem.c: remove surplus else after return clause Date: Thu, 30 Mar 2023 16:49:10 +0800 Message-Id: <20230330084911.1565071-2-15330273260@189.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230330084911.1565071-1-15330273260@189.cn> References: <20230330084911.1565071-1-15330273260@189.cn> MIME-Version: 1.0 X-Spam-Status: No, score=0.6 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FROM_LOCAL_DIGITS,FROM_LOCAL_HEX,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761782039486620420?= X-GMAIL-MSGID: =?utf-8?q?1761782039486620420?= From: Sui Jingfeng else is not generally useful after return Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/drm_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index a6208e2c089b..364e3733af98 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -1150,8 +1150,8 @@ int drm_gem_pin(struct drm_gem_object *obj) { if (obj->funcs->pin) return obj->funcs->pin(obj); - else - return 0; + + return 0; } void drm_gem_unpin(struct drm_gem_object *obj) @@ -1172,7 +1172,8 @@ int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) ret = obj->funcs->vmap(obj, map); if (ret) return ret; - else if (iosys_map_is_null(map)) + + if (iosys_map_is_null(map)) return -ENOMEM; return 0;