[PATCH] drm: remove unnecessary conditionals

From: Jingyu Wang
Date: Thu Sep 08 2022 - 14:44:00 EST


iput() has already handled null and non-null parameter, so it is no
need to use if().

Signed-off-by: Jingyu Wang <jingyuwang_vip@xxxxxxx>
---
drivers/gpu/drm/drm_drv.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 8214a0b1ab7f..beec45a89ca5 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -530,10 +530,8 @@ static struct inode *drm_fs_inode_new(void)

static void drm_fs_inode_free(struct inode *inode)
{
- if (inode) {
- iput(inode);
- simple_release_fs(&drm_fs_mnt, &drm_fs_cnt);
- }
+ iput(inode);
+ simple_release_fs(&drm_fs_mnt, &drm_fs_cnt);
}

/**

base-commit: 5957ac6635a1a12d4aa2661bbf04d3085a73372a
--
2.34.1