linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	sakari.ailus@linux.intel.com
Cc: "Zhi Mao 毛智" <zhi.mao@mediatek.com>, heiko@sntech.de
Subject: Re: [PATCH v6 2/2] media: i2c: Add GC08A3 image sensor driver
Date: Wed, 28 Feb 2024 17:33:58 +0000	[thread overview]
Message-ID: <170914163823.252503.15921889437591940623@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <CAHp75VfXY=Hv_o_CYe8sNYoBa1vtYWuk4Sz1M91XUp0cf4HjnA@mail.gmail.com>

Quoting Andy Shevchenko (2024-02-28 17:17:12)
> 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.

I've used iwyu (include-what-you-use) successfully on libcamera. But I
don't know how this would translate to working on the kernel, with a
more complex build system.

But indeed, tooling already exists [0] to do these checks, and is packaged
in distros [1]

[0] https://include-what-you-use.org/
[1] https://manpages.ubuntu.com/manpages/focal/man1/iwyu_tool.1.html

--
Kieran


> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko

  reply	other threads:[~2024-02-28 17:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  1:32 [PATCH v6 0/2] media: i2c: Add support for GC08A3 sensor Zhi Mao
2024-02-27  1:32 ` [PATCH v6 1/2] media: dt-bindings: i2c: add GalaxyCore GC08A3 image sensor Zhi Mao
2024-02-27  1:32 ` [PATCH v6 2/2] media: i2c: Add GC08A3 image sensor driver Zhi Mao
2024-02-27 12:46   ` Andy Shevchenko
2024-02-27 13:26     ` Sakari Ailus
2024-02-28  3:19     ` Zhi Mao (毛智)
2024-02-28  9:22       ` Andy Shevchenko
2024-02-28 12:02         ` sakari.ailus
2024-02-28 17:17           ` Andy Shevchenko
2024-02-28 17:33             ` Kieran Bingham [this message]
2024-02-28 18:06               ` Andy Shevchenko
2024-03-03  2:46     ` Zhi Mao (毛智)

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=170914163823.252503.15921889437591940623@ping.linuxembedded.co.uk \
    --to=kieran.bingham@ideasonboard.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=heiko@sntech.de \
    --cc=sakari.ailus@linux.intel.com \
    --cc=zhi.mao@mediatek.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;
as well as URLs for NNTP newsgroup(s).