From: Dan Carpenter <error27@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] media: ti: cal: remove unnecessary error check
Date: Tue, 22 Sep 2026 13:34:22 +0300 [thread overview]
Message-ID: <arJZri2tFcBqBLgN@stanley.mountain> (raw)
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.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
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(-)
diff --git a/drivers/media/platform/ti/cal/cal-video.c b/drivers/media/platform/ti/cal/cal-video.c
index 59f0cc4f0d1a..1990cab77344 100644
--- a/drivers/media/platform/ti/cal/cal-video.c
+++ b/drivers/media/platform/ti/cal/cal-video.c
@@ -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)
--
2.53.0
next reply other threads:[~2026-09-22 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 10:34 Dan Carpenter [this message]
2026-09-23 10:22 ` [PATCH] media: ti: cal: remove unnecessary error check Yemike Abhilash Chandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=arJZri2tFcBqBLgN@stanley.mountain \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=y-abhilashchandra@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox