lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJMQK-joqHaJeTNurzecmXcZ_eiK+24Tc0ok2zcFdUNXz3TQmQ@mail.gmail.com>
Date:   Tue, 7 Jun 2022 15:53:31 +0800
From:   Hsin-Yi Wang <hsinyi@...omium.org>
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Matthias Brugger <matthias.bgg@...il.com>,
        dri-devel@...ts.freedesktop.org,
        linux-mediatek@...ts.infradead.org,
        Rob Clark <robdclark@...omium.org>,
        Douglas Anderson <dianders@...omium.org>,
        Rob Herring <robh+dt@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/8] drm/panel: Add an API drm_panel_get_orientation()
 to return panel orientation

On Tue, Jun 7, 2022 at 3:06 AM Stephen Boyd <swboyd@...omium.org> wrote:
>
> Quoting Hsin-Yi Wang (2022-06-06 08:24:24)
> > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > index f634371c717a..e12056cfeca8 100644
> > --- a/drivers/gpu/drm/drm_panel.c
> > +++ b/drivers/gpu/drm/drm_panel.c
> > @@ -223,6 +223,15 @@ int drm_panel_get_modes(struct drm_panel *panel,
> >  }
> >  EXPORT_SYMBOL(drm_panel_get_modes);
> >
> > +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel)
>
> Should 'panel' be marked const to indicate that it can't be modified?
>

But .get_orientation() will need to call to_XXX_panel, eg.
static inline struct boe_panel *to_boe_panel(struct drm_panel *panel)

==> .get_modes(panel) <-- can't be const.
==> drm_panel_get_orientation(panel) <-- can't be const.

We can definitely cast it in the functions, or make to_XXX_panel()
accept const, but I think this will lose the meaning of using const
anyway.

> > +{
> > +       if (panel && panel->funcs && panel->funcs->get_orientation)
> > +               return panel->funcs->get_orientation(panel);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ