* [PATCH] media: i2c: ov5648: remove unnecessary NULL check
@ 2021-01-25 8:46 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-01-25 8:46 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Paul Kocialkowski
Cc: Sakari Ailus, linux-media, kernel-janitors
The "mode_index == ARRAY_SIZE(ov5648_modes)" check ensures that we
exited the loop via a break statement so we know that "mode" must
be valid. Delete this unnecessary NULL check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/media/i2c/ov5648.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c
index 609aa67b54ce..b3864be33df2 100644
--- a/drivers/media/i2c/ov5648.c
+++ b/drivers/media/i2c/ov5648.c
@@ -2337,7 +2337,7 @@ static int ov5648_enum_frame_interval(struct v4l2_subdev *subdev,
}
}
- if (mode_index == ARRAY_SIZE(ov5648_modes) || !mode)
+ if (mode_index == ARRAY_SIZE(ov5648_modes))
return -EINVAL;
switch (interval_enum->code) {
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-26 3:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-25 8:46 [PATCH] media: i2c: ov5648: remove unnecessary NULL check Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).