From patchwork Thu Mar 30 08:49:09 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: 13193660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC386C761AF for ; Thu, 30 Mar 2023 08:49:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61AF610ED42; Thu, 30 Mar 2023 08:49:27 +0000 (UTC) Received: from 189.cn (ptr.189.cn [183.61.185.101]) by gabe.freedesktop.org (Postfix) with ESMTP id CA8CF10ED3C for ; Thu, 30 Mar 2023 08:49:23 +0000 (UTC) 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 6F7861002D0; Thu, 30 Mar 2023 16:49:16 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-7b48884fd-ljp89 with ESMTP id fc918797fb554a98a1ac45f56fe6f755 for maarten.lankhorst@linux.intel.com; Thu, 30 Mar 2023 16:49:21 CST X-Transaction-ID: fc918797fb554a98a1ac45f56fe6f755 X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 From: Sui Jingfeng <15330273260@189.cn> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , suijingfeng , Sumit Semwal , Christian Koenig Subject: [PATCH 1/3] dma-buf/dma-buf.c: add a blank line between the two adjoining functions Date: Thu, 30 Mar 2023 16:49:09 +0800 Message-Id: <20230330084911.1565071-1-15330273260@189.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-mm-sig@lists.linaro.org, loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, nathan@kernel.org, linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sui Jingfeng Trivial cleanup, no functional change. Signed-off-by: Sui Jingfeng --- drivers/dma-buf/dma-buf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index aa4ea8530cb3..485b022a31fa 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -777,10 +777,10 @@ static void mangle_sg_table(struct sg_table *sg_table) for_each_sgtable_sg(sg_table, sg, i) sg->page_link ^= ~0xffUL; #endif - } -static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, - enum dma_data_direction direction) + +static struct sg_table *__map_dma_buf(struct dma_buf_attachment *attach, + enum dma_data_direction direction) { struct sg_table *sg_table; signed long ret; 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: 13193658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B822BC761AF for ; Thu, 30 Mar 2023 08:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10B6810E191; Thu, 30 Mar 2023 08:49:26 +0000 (UTC) Received: from 189.cn (ptr.189.cn [183.61.185.101]) by gabe.freedesktop.org (Postfix) with ESMTP id BE18F10E191 for ; Thu, 30 Mar 2023 08:49:23 +0000 (UTC) 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 From: Sui Jingfeng <15330273260@189.cn> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , suijingfeng , Sumit Semwal , Christian Koenig 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-mm-sig@lists.linaro.org, loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, nathan@kernel.org, linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; From patchwork Thu Mar 30 08:49:11 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: 13193659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82B3CC77B61 for ; Thu, 30 Mar 2023 08:49:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F22F210ED3F; Thu, 30 Mar 2023 08:49:26 +0000 (UTC) Received: from 189.cn (ptr.189.cn [183.61.185.101]) by gabe.freedesktop.org (Postfix) with ESMTP id AF07610E191 for ; Thu, 30 Mar 2023 08:49:24 +0000 (UTC) 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 A48DB100207; Thu, 30 Mar 2023 16:49:22 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-7b48884fd-ljp89 with ESMTP id 2a8c5f62236a4e4db151dd2bf1489911 for maarten.lankhorst@linux.intel.com; Thu, 30 Mar 2023 16:49:23 CST X-Transaction-ID: 2a8c5f62236a4e4db151dd2bf1489911 X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 From: Sui Jingfeng <15330273260@189.cn> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , suijingfeng , Sumit Semwal , Christian Koenig Subject: [PATCH 3/3] drm/fbdev-generic: optimize out a redundant assignment clause Date: Thu, 30 Mar 2023 16:49:11 +0800 Message-Id: <20230330084911.1565071-3-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-mm-sig@lists.linaro.org, loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, nathan@kernel.org, linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sui Jingfeng The assignment already done in drm_client_buffer_vmap(), this patch save a copy. No functional change. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/drm_fbdev_generic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 8e5148bf40bb..be4522268927 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -183,7 +183,7 @@ static int drm_fbdev_generic_damage_blit(struct drm_fb_helper *fb_helper, struct drm_clip_rect *clip) { struct drm_client_buffer *buffer = fb_helper->buffer; - struct iosys_map map, dst; + struct iosys_map map; int ret; /* @@ -203,8 +203,7 @@ static int drm_fbdev_generic_damage_blit(struct drm_fb_helper *fb_helper, if (ret) goto out; - dst = map; - drm_fbdev_generic_damage_blit_real(fb_helper, clip, &dst); + drm_fbdev_generic_damage_blit_real(fb_helper, clip, &map); drm_client_buffer_vunmap(buffer);