Re: [PATCH v6 2/2] media: i2c: Add GC08A3 image sensor driver

Andy Shevchenko
2024-02-28T17:18:04Z

On Wed, Feb 28, 2024 at 2:03 PM sakari.ailus@linux.intel.com
<sakari.ailus@linux.intel.com> wrote:
> On Wed, Feb 28, 2024 at 11:22:13AM +0200, Andy Shevchenko wrote:
> > > Another, I also reviewed some other sensor driver code(such as
> > > gc0a08/gc2145 and imx/ov), they are all the same.
> >
> > They are also problematic. So what?
>
> The situation is the same in a large number of drivers, also outside the
> media tree. It's also not trivial to figure out which header should be
> included and it tends to be that if it compiles without warnings,
> developers won't bother trying to figure out what should still be changed.

I spent about 20 minutes reading the code. Yes, for inexperienced
developers it can take 3x longer, but still, much longer time was
spent on writing that code to begin with. So, the headers are a part
of the evolution of the code. And now it's pure technical debt with no
excuses to not fulfill.

TL;DR: It's (rightfully) assumed that the developer *knows* their code.

> I wonder if this could be automated by using the C preprocessor and a
> small Perl script. :-)

There is a Google project coming from Clang people or so, but I have
no idea of the state of affairs.

--
With Best Regards,
Andy Shevchenko