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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ghhu3fypfqls5wazqy6snttfi7eemsjwvgx3z2b4qt5ov2na2e@gp7qlz4gevgp>
Date: Sat, 24 May 2025 03:38:55 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Marco Felsch <m.felsch@...gutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        andrzej.hajda@...el.com, neil.armstrong@...aro.org, rfoss@...nel.org,
        jonas@...boo.se, jernej.skrabec@...il.com,
        maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
        tzimmermann@...e.de, airlied@...il.com, simona@...ll.ch,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        kernel@...gutronix.de
Subject: Re: [PATCH 1/3] drm/bridge: fsl-ldb: make use of driver_private

On Thu, May 15, 2025 at 01:04:52AM +0200, Marco Felsch wrote:
> Hi Laurent,
> 
> On 25-05-15, Laurent Pinchart wrote:
> > Hi Marco,
> > 
> > Thank you for the patch.
> > 
> > On Thu, May 15, 2025 at 12:24:51AM +0200, Marco Felsch wrote:
> > > Make use of the drm_bridge::driver_private data instead of
> > > container_of() wrapper.
> > 
> > I suppose this is a personal preference, but I like usage of
> > container_of() better. In my opinion it conveys better that struct
> > fsl_ldb "unherits" from struct drm_bridge.
> 
> Yes, we can drop this patch if container_of() or to_fsl_ldb() is
> preferred. I just saw the driver_private field and why not making use of
> it since we do that a lot, same is true for container_of :)

container_of() generally is a more preferred form, because it provides
type safety. It doesn't perform blind casts. Using driver_data involves
using void pointer, which can be cast to any structure pointer. It is
easy to make hard-to-notice mistakes.

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ