Re: [PATCH v2 0/2] Add capability to append to property

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



On 8/30/24 3:09 AM, Geert Uytterhoeven wrote:
Hi Ayush,

On Thu, Aug 29, 2024 at 10:04 PM Ayush Singh <ayush@xxxxxxxxxxxxxxx> wrote:
Allow appending values to a property instead of overriding the previous
values of property.

Thanks for your series!

Open items

- Appending to non-existent property: Currently am just adding a new
   property if not found. Not sure if this is the desired behaviour.

I think this should raise an error.


I was thinking this at first too, but if we want to be consistent we
may want to instead go with adding the new property without error for
the following reasons.

High level, nodes and properties should behave the similarly. When
we run into an already defined node we take the content and append
to the existing node. But for properties we replace the content,
not append. This is the fundamental asymmetry that causes us to
need /append-property/ but not need /append-node/, nodes append
by default.

When we want to replace a node we do /delete-node/ first, followed
by the defining the new node content. If properties were default
append, we would do the same with /delete-property/ followed by
the new content. If we could do all this over that would have made
the semantics much cleaner and only required /delete-node/ and
/delete-property/, but little late for that now..

So when we label a property with /append-property/, we want it to
have the same semantics as nodes. Which is to append if it exists,
and to add new if not, without error.

Andrew




[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