Re: [PATCH i-g-t 00/16] igt: clean up typedef usage, use for_each_output() more

Ville Syrjälä
2026-04-14T16:09:48Z

On Tue, Apr 14, 2026 at 06:51:39PM +0300, Jani Nikula wrote:
> On Tue, 14 Apr 2026, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Tue, Apr 14, 2026 at 10:14:20AM +0300, Jani Nikula wrote:
> >> This series spiraled into a few things:
> >>
> >> - use typedefs like igt_foo_t more consistently instead of struct
> >> igt_foo
> >
> > I'm not a huge fan of the typedefs but getting rid of them now
> > would involve a gargantuan patch. So best to just accept them
> > I guess.
>
> Yeah, in general I'd reserve typedefs for opaque types that you really
> aren't supposed to look at. It feels weird to have some foo_t and then
> go on to access its members implicitly assuming it's a struct.

Even for opaque types the non-typedef seems a bit better to me
because you can't really forward declare typedefs without
mentioning the struct anyway.

typdefs aren't even proper types in C, more like aliases. You
can typedef the same underlying type multiple times and then
use any of the typdefs (or the actual type) interchangeably.
The compiler will not even tell you that you're being silly.

>
> But I think that ship has sailed, and we're better off focusing on
> consistency here.
>
> And we're just a couple of brainwashed kernel developers avoiding
> typedefs. ;)
>
> > Series is
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Thanks, pushed the lot.
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel

--
Ville Syrjälä
Intel