drm/debugfs: Drop conditionals around of_node pointers

Doug Anderson dianders at chromium.org
Tue Apr 30 21:33:17 UTC 2024


Hi,

On Mon, Apr 29, 2024 at 6:16 PM 隋景峰 <suijingfeng at bosc.ac.cn> wrote:
>
> Hi,
>
>
> > -----原始邮件-----
> > 发件人: "Maxime Ripard" <mripard at kernel.org>
> > 发送时间: 2024-04-29 19:30:24 (星期一)
> > 收件人: "Sui Jingfeng" <suijingfeng at bosc.ac.cn>
> > 抄送: "Sui Jingfeng" <sui.jingfeng at linux.dev>, "Maarten Lankhorst" <maarten.lankhorst at linux.intel.com>, "Thomas Zimmermann" <tzimmermann at suse.de>, "David Airlie" <airlied at gmail.com>, "Daniel Vetter" <daniel at ffwll.ch>, "Douglas Anderson" <dianders at chromium.org>, "Laurent Pinchart" <laurent.pinchart+renesas at ideasonboard.com>, "Biju Das" <biju.das.jz at bp.renesas.com>, dri-devel at lists.freedesktop.org, linux-kernel at vger.kernel.org
> > 主题: Re: drm/debugfs: Drop conditionals around of_node pointers
> >
> > On Sun, Apr 28, 2024 at 04:52:13PM +0800, Sui Jingfeng wrote:
> > > ping
> > >
> > > 在 2024/3/22 06:22, Sui Jingfeng 写道:
> > > > Having conditional around the of_node pointer of the drm_bridge structure
> > > > turns out to make driver code use ugly #ifdef blocks.
> >
> > The code being ugly is an opinion, what problem is it causing exactly?
> >
> > > Drop the conditionals to simplify debugfs.
> >
> > What does it simplifies?
> >
> > > >
> > > > Fixes: d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")
> > > > Signed-off-by: Sui Jingfeng <sui.jingfeng at linux.dev>
> >
> > Why do we want to backport that patch to stable?

Technically it's not CCing stable and so it's not really incorrect.
...but I agree that this is a bit of a stretch to call it a "Fix".
Maybe drop the "Fixes" line?


> My commit message is written based on commit of d8dfccde2709
>
> $ git show c9e358dfc4a8
>
>     This patch is based on commit c9e358dfc4a8 ("driver-core: remove
>     conditionals around devicetree pointers").
>
>     Having conditional around the of_node pointer of the drm_bridge
>     structure turns out to make driver code use ugly #ifdef blocks. Drop the
>     conditionals to simplify drivers. While this slightly increases the size
>     of struct drm_bridge on non-OF system, the number of bridges used today
>     and foreseen tomorrow on those systems is very low, so this shouldn't be
>     an issue.
>
>     So drop #if conditionals by adding struct device_node forward declaration.
>
> > Maxime
>
> I'm just start to contribute by mimic other people's tone, there seems no need
> to over read.

I think the fact that you skipped the reference to commit c9e358dfc4a8
("driver-core: remove conditionals around devicetree pointers") was
relevant here. Referencing that commit makes it easy for the reader to
see that you are following convention used throughout the kernel and
not just asserting your own opinion about style.

If you add that reference into your commit message and send a v2, I'm
happy to apply it.

-Doug


More information about the dri-devel mailing list