[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1551394449-122395-1-git-send-email-shaobo@cs.utah.edu>
Date:   Thu, 28 Feb 2019 15:54:06 -0700
From:   Shaobo He <shaobo@...utah.edu>
To:     linux-media@...r.kernel.org
Cc:     shaobo@...utah.edu, Mauro Carvalho Chehab <mchehab@...nel.org>,
        Simon Horman <horms+renesas@...ge.net.au>,
        Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
        Hans Verkuil <hans.verkuil@...co.com>,
        Kees Cook <keescook@...omium.org>,
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] platform/sh_veu.c: remove redundant NULL pointer checks
Function `sh_veu_find_fmt` returns an address that is an addition of a
base pointer `sh_veu_fmt` and an offset. The base pointer refers to a
global variable of which address cannot be NULL. Therefore, this commit
removes the NULL pointer checks on the return values of function
`sh_veu_find_fmt`.
Signed-off-by: Shaobo He <shaobo@...utah.edu>
---
 drivers/media/platform/sh_veu.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 09ae64a..3069015 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -493,9 +493,6 @@ static int sh_veu_try_fmt_vid_cap(struct file *file, void *priv,
 	const struct sh_veu_format *fmt;
 
 	fmt = sh_veu_find_fmt(f);
-	if (!fmt)
-		/* wrong buffer type */
-		return -EINVAL;
 
 	return sh_veu_try_fmt(f, fmt);
 }
@@ -506,9 +503,6 @@ static int sh_veu_try_fmt_vid_out(struct file *file, void *priv,
 	const struct sh_veu_format *fmt;
 
 	fmt = sh_veu_find_fmt(f);
-	if (!fmt)
-		/* wrong buffer type */
-		return -EINVAL;
 
 	return sh_veu_try_fmt(f, fmt);
 }
-- 
2.7.4
Powered by blists - more mailing lists