Re: [PATCH v2 08/12] media: i2c: Add hblank control to ov8865

Andy Shevchenko
2021-08-10T13:11:36Z

On Tue, Aug 10, 2021 at 1:59 AM Daniel Scally <djrscally@gmail.com> wrote:
>
> Add a V4L2_CID_HBLANK control to the ov8865 driver. This is read only
> with timing control intended to be done via vblanking alone.

...

> + hblank = mode->hts < mode->output_size_x ? 0 : mode->hts - mode->output_size_x;

In both cases can be

hblank = max(mode->output_size_x, mode->hts) - mode->output_size_x;

or max_t() in case types are different (but in this case the code
might be uglier).

> + ctrls->hblank = v4l2_ctrl_new_std(handler, ops, V4L2_CID_HBLANK, hblank,
> + hblank, 1, hblank);

> +

Redundant blank line (pun is not intended :).

> + if (ctrls->hblank)
> + ctrls->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;

...

> + hblank = mode->hts < mode->output_size_x ? 0 : mode->hts - mode->output_size_x;

See above.

--
With Best Regards,
Andy Shevchenko