Re: [PATCH] media: staging: atomisp: remove unnecessary NULL checks in sensor drivers

From: Andy Shevchenko
Date: Sun Dec 28 2025 - 14:52:56 EST


On Fri, Dec 12, 2025 at 03:38:14PM +0300, Mikhail Dmitrichenko wrote:
> There are unnecessary NULL checks for v4l2_subdev_format::format
> pointer in ov2722 and gc2235 sensor driver format operations.
> The fmt pointer is derived from &format->format where format
> is a pointer to an embedded struct v4l2_mbus_framefmt inside
> struct v4l2_subdev_format, therefore fmt cannot be NULL.
>
> Remove unnecessary NULL checks for v4l2_subdev_format::format
> pointer to avoid unnecessary computations and make code
> clearer.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Sakari, can you pick this up?

> Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")

This is not needed. There is no bug to test non-NULL pointer.

> Signed-off-by: Mikhail Dmitrichenko <mdmitrichenko@xxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko