Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5425896pxj; Wed, 23 Jun 2021 00:37:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNfHl60JWa5JLAtzv45H5o9v4IH+fUa7DC8I23TzICRP0NJPTjObI/6VKeqroa+7nW9cCA X-Received: by 2002:a17:906:b2cb:: with SMTP id cf11mr8652884ejb.448.1624433852406; Wed, 23 Jun 2021 00:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624433852; cv=none; d=google.com; s=arc-20160816; b=l/fW/Ls7sVsynVhHl/5QBxeHdb83lGVTcxkClss11srubGO+hXcmKRlkMCij/CbLAz HutkPKIn8zxrJwwBtXcK11pifwv3bruRWfMvRfcZxcbrQQagMEylXahwt3HquHC0qDIn reNSOHsOaTSHBGHuIJa01yrKGouNCKzdloLE3CCIzK46ekPrFxiOiTAvlHC2xvPvLpfO PeJjulfCjFnYvv1L9Yi6lTPyBNBnXnuhKVhVlcrIa98MoTXgeJEaxnMd+JKareg5UHWz ElO9QwhINywjRD+sLTLVP0Y4dzC6dyHvOzvamvUaevgzHRwQzR2GIT+ISlQNxHnu98rc 6B3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=bwPWReaaMjrRaxBmx4kzXhOHhgZA/JQAbqq1wGSWjbw=; b=xM3VR1ZwxvxYsUmOWx1VkIKVoW1hjb5d+6+zbNyAjJ8ZrXWPcVe1i+KWSpkG8cXDKm 4mb5NSzHoUqbLFQwxs/DlAShiDZDVenJrsJ0rce04rh80as9lymW6pl1O/67CJfvxrzo T7mScrqxfDFjLhlpdonjdWnBjvcN9MDort50zcNKZwz8N12RraxAptyY7fg7VWRWC7Wq ZkDqTZXXqg+oKvCunR3/TPz5whHLJwb1SlrQYNh4AKcpTOg1wJ0Ryzf3KfjmFYB+ysl1 W/0bqgifhxyG7Tz9aoP8ctJmWE2w6sRwztFLe0/MZmxU5AESWiFseHTjqB2ZkkqL0WSf qeVw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si6176691edm.571.2021.06.23.00.37.09; Wed, 23 Jun 2021 00:37:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbhFWHiW (ORCPT + 99 others); Wed, 23 Jun 2021 03:38:22 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:32792 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230163AbhFWHiT (ORCPT ); Wed, 23 Jun 2021 03:38:19 -0400 X-UUID: 0d48c2887b92484d8d70713bed3920d9-20210623 X-UUID: 0d48c2887b92484d8d70713bed3920d9-20210623 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1373349356; Wed, 23 Jun 2021 15:35:58 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 23 Jun 2021 15:35:56 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 23 Jun 2021 15:35:56 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Hans Verkuil , Jernej Skrabec CC: Maoguang Meng , Krzysztof Kozlowski , daoyuan huang , Ping-Hsun Wu , Geert Uytterhoeven , Rob Landley , Laurent Pinchart , , , , , , , , , , , , , , , , Subject: [RFC PATCH V0 05/10] media: mtk-mdp3: remove unnecessary Null check Date: Wed, 23 Jun 2021 15:35:44 +0800 Message-ID: <20210623073549.24170-5-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210623073549.24170-1-moudy.ho@mediatek.com> References: <20210623073549.24170-1-moudy.ho@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: daoyuan huang Remove logically unnecessary NULL check in call back function. Due to no NULL callback param should occur in normal case; and if we use NULL check to jump over this clock off step, the clock ref. count may go asymmetric. Signed-off-by: daoyuan huang --- drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c index 42a51061677a..df956ca3685c 100644 --- a/drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c @@ -349,13 +349,8 @@ static void mdp_auto_release_work(struct work_struct *work) auto_release_work); mdp = cb_param->mdp; - if (cb_param->comps && cb_param->num_comps) { - int i; - - for (i = 0; i < cb_param->num_comps; i++) - mdp_comp_clock_off(&mdp->pdev->dev, - &cb_param->comps[i]); - } + mdp_comp_clocks_off(&mdp->pdev->dev, cb_param->comps, + cb_param->num_comps); kfree(cb_param->comps); kfree(cb_param); -- 2.18.0