Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp658582pxb; Sun, 10 Oct 2021 07:57:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZxgOgWsIGiWx2/Ux6qpQKMVBxDNzjJ+tU+CP4x7eaEjbYyGKnlgspwUYo0dwgXEGxGuxc X-Received: by 2002:a17:902:76c3:b0:13c:957d:561f with SMTP id j3-20020a17090276c300b0013c957d561fmr19281375plt.27.1633877822265; Sun, 10 Oct 2021 07:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633877822; cv=none; d=google.com; s=arc-20160816; b=dXxoglCRIInSQjS7WKWWCliJJwweNC8+I+HQ4aix23o2rwalwxG4Jt5omBjtRwlraj MWWlrIK7+GhYz7R14CM3U9GRwGWlbLH2T3cjlL1ZESNRzikUcQQpBCFF6u/rokNHqvJN Ri+K/cWUXJsM/COx9bB7mp30crILc6MtGXAK7krK87Ut0mGe20letydc3zUpuOOPl/WA fcWS/W/BhS8YTKhZC1M4SDDiXMnDU108PiJ3U+RFXf464qSWGVuwo6eEDV2zIRjqceyi 7Y3KD8bPTJCnfwVSNqzuYHddaXgfVmbYKOULUvBLikOGrX4xQojhKl6/qBcfIaTg+wFa WbDw== 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 :message-id:date:subject:cc:to:from; bh=IYAceISjt/DbpXj6O5OY9bVadQqLLS5yPcJ0GequVPk=; b=hn8cgwMyXtgwXIrAbl6x2rmYMj99uwlh46bAp367p/UGk4k3vesE/sFNsXx2Z5WWMW hiuH7C388YSi9EWP6PzwFzKaHQbjvY1HmwYxm9lXUk2z6VtzSG4RK2AuZQNGaazHlIAD VLdTOX9ehk51BxmPe64PTe0uPgCPeD2h8pNje4BfD+Ezu9cmWr/T703Ls3VJwxXN2aVg G6iDUGu0xc2YzQU5Hq/D+qeuZVRG4yAS3OmTAqX5OHkQa7XvbpVyDrvC5Yy3FaoaxYPj qjwdmokhb5+bkEN/8b0b52A8PCF8WcDISno4eR9VRt0ysNiH26O22D2SzyuJWIMvx0FU 7aaQ== 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 s25si7372309pfg.333.2021.10.10.07.56.49; Sun, 10 Oct 2021 07:57:02 -0700 (PDT) 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 S232858AbhJJOCT (ORCPT + 99 others); Sun, 10 Oct 2021 10:02:19 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:41825 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232494AbhJJOCS (ORCPT ); Sun, 10 Oct 2021 10:02:18 -0400 Received: from pop-os.home ([90.126.248.220]) by mwinf5d78 with ME id 4E0F260064m3Hzu03E0Fup; Sun, 10 Oct 2021 16:00:18 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Oct 2021 16:00:18 +0200 X-ME-IP: 90.126.248.220 From: Christophe JAILLET To: l.stach@pengutronix.de, linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robdclark@gmail.com, sean@poorly.run, jyri.sarha@iki.fi, tomba@kernel.org, linux-graphics-maintainer@vmware.com, zackr@vmware.com, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] drm: Remove redundant 'flush_workqueue()' calls Date: Sun, 10 Oct 2021 15:59:40 +0200 Message-Id: <75e8ba40076ad707d47e3a3670e6b23c1b8b11bc.1633874223.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org '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/gpu/drm/etnaviv/etnaviv_gpu.c | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 1 - drivers/gpu/drm/msm/edp/edp_ctrl.c | 1 - drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +--- drivers/gpu/drm/vmwgfx/ttm_memory.c | 1 - 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 789acae37f55..06bde46df451 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1733,7 +1733,6 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master, DBG("%s", dev_name(gpu->dev)); - flush_workqueue(gpu->wq); destroy_workqueue(gpu->wq); etnaviv_sched_fini(gpu); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index c86b5090fae6..462ea65ebf89 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1925,7 +1925,6 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) DBG(""); dsi_tx_buf_free(msm_host); if (msm_host->workqueue) { - flush_workqueue(msm_host->workqueue); destroy_workqueue(msm_host->workqueue); msm_host->workqueue = NULL; } diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c index fe1366b4c49f..07129a6e5dbb 100644 --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c @@ -1190,7 +1190,6 @@ void msm_edp_ctrl_destroy(struct edp_ctrl *ctrl) return; if (ctrl->workqueue) { - flush_workqueue(ctrl->workqueue); destroy_workqueue(ctrl->workqueue); ctrl->workqueue = NULL; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 737453b6e596..5ba7c8f28419 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -61,10 +61,8 @@ static void msm_hdmi_destroy(struct hdmi *hdmi) * at this point, hpd has been disabled, * after flush workq, it's safe to deinit hdcp */ - if (hdmi->workq) { - flush_workqueue(hdmi->workq); + if (hdmi->workq) destroy_workqueue(hdmi->workq); - } msm_hdmi_hdcp_destroy(hdmi); if (hdmi->phy_dev) { diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 6b03f89a98d4..3ddb7c710a3d 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -186,10 +186,8 @@ static void tilcdc_fini(struct drm_device *dev) if (priv->mmio) iounmap(priv->mmio); - if (priv->wq) { - flush_workqueue(priv->wq); + if (priv->wq) destroy_workqueue(priv->wq); - } dev->dev_private = NULL; diff --git a/drivers/gpu/drm/vmwgfx/ttm_memory.c b/drivers/gpu/drm/vmwgfx/ttm_memory.c index edd17c30d5a5..7f7fe35fc21d 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_memory.c +++ b/drivers/gpu/drm/vmwgfx/ttm_memory.c @@ -468,7 +468,6 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) struct ttm_mem_zone *zone; unsigned int i; - flush_workqueue(glob->swap_queue); destroy_workqueue(glob->swap_queue); glob->swap_queue = NULL; for (i = 0; i < glob->num_zones; ++i) { -- 2.30.2