From patchwork Thu Oct 14 18:21:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 77758 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mb5MU-002Hki-LR; Thu, 14 Oct 2021 18:21:50 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbhJNSXx (ORCPT + 1 other); Thu, 14 Oct 2021 14:23:53 -0400 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:63139 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233913AbhJNSXx (ORCPT ); Thu, 14 Oct 2021 14:23:53 -0400 Received: from pop-os.home ([92.140.161.106]) by smtp.orange.fr with ESMTPA id b5MPmB7sXBazob5MPmY6R9; Thu, 14 Oct 2021 20:21:46 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Thu, 14 Oct 2021 20:21:46 +0200 X-ME-IP: 92.140.161.106 From: Christophe JAILLET To: minghsiu.tsai@mediatek.com, houlong.wei@mediatek.com, andrew-ct.chen@mediatek.com, tiffany.lin@mediatek.com, mchehab@kernel.org, matthias.bgg@gmail.com Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] media: mtk-vpu: Remove redundant 'flush_workqueue()' calls Date: Thu, 14 Oct 2021 20:21:43 +0200 Message-Id: <9788bdfee564000a1c4d68126d25570c7feb1055.1634235609.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by: Christophe JAILLET --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index 7f1647da0ade..7bd715fc844d 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -964,10 +964,8 @@ static int mtk_vpu_remove(struct platform_device *pdev) #ifdef CONFIG_DEBUG_FS debugfs_remove(vpu_debugfs); #endif - if (vpu->wdt.wq) { - flush_workqueue(vpu->wdt.wq); + if (vpu->wdt.wq) destroy_workqueue(vpu->wdt.wq); - } vpu_free_ext_mem(vpu, P_FW); vpu_free_ext_mem(vpu, D_FW); mutex_destroy(&vpu->vpu_mutex);