[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBGPVFN5DTGU.5UTP35ALYS2Q@brighamcampbell.com>
Date: Sun, 20 Jul 2025 01:50:43 -0600
From: "Brigham Campbell" <me@...ghamcampbell.com>
To: "Diogo Ivo" <diogo.ivo@...nico.ulisboa.pt>, "Doug Anderson"
<dianders@...omium.org>
Cc: <tejasvipin76@...il.com>, <skhan@...uxfoundation.org>,
<linux-kernel-mentees@...ts.linux.dev>, <dri-devel@...ts.freedesktop.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Neil
Armstrong" <neil.armstrong@...aro.org>, "Jessica Zhang"
<jessica.zhang@....qualcomm.com>, "Maarten Lankhorst"
<maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
"Thomas Zimmermann" <tzimmermann@...e.de>, "David Airlie"
<airlied@...il.com>, "Simona Vetter" <simona@...ll.ch>
Subject: Re: [PATCH v4 2/4] drm/panel: jdi-lpm102a188a: Fix bug and clean up
driver
On Sat Jul 19, 2025 at 11:10 AM MDT, Diogo Ivo wrote:
>> nit: can just be this:
>>
>> struct mipi_dsi_multi_context dsi_ctx = {};
>
> I am not an expert here but I was under the impression that this is only
> valid with C23 while the kernel is written in C11. Is there something I
> am missing?
>
> Diogo
You're right, C23 was the first standard to bless the usage of the empty
initializer, ` = {};`, but if I'm right, it's been a GNU extension long
before C11. At risk of being pedantic, I'll draw attention to line 580
of the kernel's root Makefile:
KBUILD_CFLAGS += -std=gnu11
The kernel is technically written in the GNU variant of C11, extensions
and all. In fact, the first patch of this series uses optional variadic
macro arguments, which aren't a part of any official C standard as far
as I'm aware.
In any case, a simple grep for some forms of the empty initializer shows
usages all over the drm subsystem.
That said, I don't know if GNU extensions are formally documented or
where one would look for that information. Importantly, I am by far the
junior as far as kernel coding is concerned. I yield to your experience
and I'm happy to change this initialization in v6 if that's best.
Cheers,
Brigham
Powered by blists - more mailing lists