Re: [PATCH v2 1/2] pylibfdt: Add a method to access the device tree directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi David,

On 10 September 2017 at 00:43, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Thu, Aug 31, 2017 at 04:41:59AM -0600, Simon Glass wrote:
> > When calling libfdt functions which are not supported by the Fdt class it
> > is necessary to get direct access to the device tree data. At present this
> > requries using the internal _fdt member. Add a new method to provide
> > public access to this.
> >
> > Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>
>
> Sorry I've taken so long to look at this.
>
> I don't think this actually has much value.  You're directly returning
> _fdt, which is a mutable object.  Anything bad you can do to the
> object by accessing _fdt directly you can do just as badly via this
> method.
>
> Which makes this an abstraction that doesn't abstract, and an
> interface that doesn't actually protect anything, even notionally.
>
> If you want things from outside to be able to access the raw blob, I
> suggest you just remove the underscore and make .fdt an advertised,
> accessible attribute of the object.
>
>
Even longer delay. I've changed it to a copy for v3 - is that better?
I don't like the idea of someone changing it, but perhaps I am being
too precious.

Regards,
Simon
--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux