Re: [PATCH v2 00/10] pylibfdt: Enhance pylibfdt support to cover sequential-write

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



On Wed, Jun 06, 2018 at 03:36:59PM -0600, Simon Glass wrote:
> 
> This adds the sequential-write interface which provides a way to create a
> device tree from scratch. It also includes various other improvements and
> additions to the existing functionality.
> 
> This requires the following v4 patches:
> 
> 	pylibfdt: Return string instead of bytearray from getprop()
> 	pylibfdt: Allow reading integer values from properties
> 
> Note: I'm sending this now rather than waiting on comments for patch 10/10
> since there is enough rework here to be getting on with.

I've now applied most of these.  A few I had further comments on.

One overall comment that applies to both the sw stuff and your
existing rw code.  At the moment, you mirror the C interface by
requiring explicit resizing of the buffers holding the dt.  That's a
somewhat awkward interface in C, but we have a reason for it (allowing
embedding in limited environments without an allocator).  In Python,
that interface is even odder, and there's not much reason for it -
Python already requires an allocator.

So, I'm wondering if it makes sense to change that interface - remove
most of the 'size' parameters (except possibly as hints), trap
FDT_ERR_NOSPACE errors from all the write functions and resize and
retry.

I've been thinking of adding an (optional) C interface that does that
for ages, though I've never had time to implement it.  In python it
should be easier to do, though.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[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