Linux Media Controller development
 help / color / mirror / Atom feed
From: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
To: Dan Carpenter <error27@gmail.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	<linux-media@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] media: ti: cal: remove unnecessary error check
Date: Wed, 23 Sep 2026 15:52:39 +0530	[thread overview]
Message-ID: <ffba8b51-fea2-418b-af26-dd287878ca97@ti.com> (raw)
In-Reply-To: <arJZri2tFcBqBLgN@stanley.mountain>

Hi Dan,
Thank you for the patch.

On 22/09/26 16:04, Dan Carpenter wrote:
> 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.
> 

It makes sense for me. Hence

Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>

Thanks and regards,
Yemike Abhilash Chandra

>   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)


      reply	other threads:[~2026-09-23 10:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 10:34 [PATCH] media: ti: cal: remove unnecessary error check Dan Carpenter
2026-09-23 10:22 ` Yemike Abhilash Chandra [this message]

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=ffba8b51-fea2-418b-af26-dd287878ca97@ti.com \
    --to=y-abhilashchandra@ti.com \
    --cc=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 \
    /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