Skip to content

Commit

Permalink
media: i2c: ov5648: remove unnecessary NULL check
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Feb 6, 2021
1 parent e88ccf0 commit 38a5023
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/i2c/ov5648.c
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,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) {
Expand Down

0 comments on commit 38a5023

Please sign in to comment.