media: ti: cal: remove unnecessary error check
Subsystems (3)
PATCH 1/1 media: ti: cal: remove unnecessary error check
The v4l2_subdev_lock_and_get_active_state() function never returns error pointers. As the comments explain, it "returns the locked active state for the subdevice, or NULL if the subdev does not support active state." None of the other callers check for an error pointer return.
Delete this unnecessary check.
---
I feel like if we don't delete the IS_ERR() check someone will eventually try to convert it into a NULL check which would be a bug.
drivers/media/platform/ti/cal/cal-video.c | 2 -- 1 file changed, 2 deletions(-)
drivers/media/platform/ti/cal/cal-video.c +0 -2
@@ -130,8 +130,6 @@ static int cal_call_active_state_set_fmt(struct v4l2_subdev *source,int ret; source_state =v4l2_subdev_lock_and_get_active_state (source); -if (IS_ERR (source_state)) -return PTR_ERR (source_state); ret =v4l2_subdev_call (source, pad, set_fmt,NULL , source_state, fmt);if (source_state)
Signature · 1 line
2.53.0
Hi Dan,
Thank you for the patch.
Quoted 5 lines · Dan Carpenter
The
v4l2_subdev_lock_and_get_active_state()function never returns error pointers. As the comments explain, it "returns the locked active state for the subdevice, or NULL if the subdev does not support active state." None of the other callers check for an error pointer return.
Quoted 7 lines
Delete this unnecessary check.
Signed-off-by Dan Carpenter <[email protected]>---
I feel like if we don't delete theIS_ERR()check someone will eventually try to convert it into a NULL check which would be a bug.
It makes sense for me. Hence
Thanks and regards,
Yemike Abhilash Chandra
Quoted 16 lines
drivers/media/platform/ti/cal/cal-video.c | 2 -- 1 file changed, 2 deletions(-)drivers/media/platform/ti/cal/cal-video.c +0
-2@@ -130,8 +130,6 @@ static int cal_call_active_state_set_fmt(struct v4l2_subdev *source,int ret; source_state =v4l2_subdev_lock_and_get_active_state (source); -if (IS_ERR (source_state)) -return PTR_ERR (source_state); ret =v4l2_subdev_call (source, pad, set_fmt,NULL , source_state, fmt);if (source_state)