[SLOF] [PATCH slof 1/2] fdt: Factor out code to replace a phandle in place

Segher Boessenkool segher at kernel.crashing.org
Tue May 22 16:04:47 AEST 2018


On Tue, May 22, 2018 at 07:23:55AM +0200, Thomas Huth wrote:
> On 21.05.2018 09:17, Alexey Kardashevskiy wrote:
> > On 19/5/18 2:10 am, Thomas Huth wrote:
> >> On 14.05.2018 12:03, Alexey Kardashevskiy wrote:
> >>> +: fdt-replace-l, 4 - swap 4 + swap ;
> >>
> >> Why "l," ? I thought the "comma" words would be used for compiling stuff
> >> into the dictionary, but apparently you're not doing this here?
> > 
> > Not just dictionary, fdt-fl.fs uses this naming approach when adding to
> > flatten DT. Segher suggested, looks nicer.
> 
> Ok, sure, but you don't *add* anything here, e.g. you also don't call
> fdt-allot like in the other "fdt-something," function. IMHO the comma is
> rather confusing here.

Agreed.

> >> Maybe you could simply use the "4 - swap 4 + swap" directly here? It's
> >> only one line of code, so not sure whether it's worth to put this into a
> >> separate Forth word.
> > 
> > "l," kind of allocates some bytes in some heap.
> 
> But your "fdt-replace-l," does not allocate anything, it just increases
> an address on the stack and a size on the stack at the same time.

fdt-replace-l, is just

  /l /string

so it is much easier to understand if you just type that directly.


Segher


More information about the SLOF mailing list