[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210623073549.24170-5-moudy.ho@mediatek.com>
Date: Wed, 23 Jun 2021 15:35:44 +0800
From: Moudy Ho <moudy.ho@...iatek.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Jernej Skrabec <jernej.skrabec@...l.net>
CC: Maoguang Meng <maoguang.meng@...iatek.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
daoyuan huang <daoyuan.huang@...iatek.com>,
Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Rob Landley <rob@...dley.net>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
<linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <tfiga@...omium.org>,
<drinkcat@...omium.org>, <acourbot@...omium.org>,
<pihsun@...omium.org>, <menghui.lin@...iatek.com>,
<sj.huang@...iatek.com>, <ben.lok@...iatek.com>,
<randy.wu@...iatek.com>, <moudy.ho@...iatek.com>,
<srv_heupstream@...iatek.com>, <frederic.chen@...iatek.com>
Subject: [RFC PATCH V0 05/10] media: mtk-mdp3: remove unnecessary Null check
From: daoyuan huang <daoyuan.huang@...iatek.com>
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 <daoyuan.huang@...iatek.com>
---
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
Powered by blists - more mailing lists